generated from habedi/template-go-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
88 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "template-rust-project" | ||
version = "0.2.3" | ||
version = "0.2.4" | ||
description = "A template for Rust projects" | ||
repository = "https://github.com/habedi/template-rust-project" | ||
license = "MIT OR Apache-2.0" | ||
|
@@ -9,8 +9,24 @@ keywords = ["project-template", "rust", "library", "application"] | |
authors = ["Hassan Abedi <[email protected]>"] | ||
homepage = "https://github.com/habedi/template-rust-project" | ||
documentation = "https://docs.rs/template-rust-project" | ||
#categories = ["development-tools"] | ||
categories = ["development-tools"] | ||
edition = "2021" | ||
rust-version = "1.83" | ||
|
||
[workspace] | ||
members = [] | ||
|
||
resolver = "2" | ||
|
||
include = [ | ||
"assets/**/*", | ||
"docs/**/*", | ||
"src/**/*", | ||
"Cargo.toml", | ||
"README.md", | ||
"LICENSE-MIT", | ||
"LICENSE-APACHE" | ||
] | ||
|
||
[lib] | ||
name = "template_rust_project" | ||
|
@@ -20,9 +36,26 @@ path = "src/lib.rs" | |
name = "template-rust-project" | ||
path = "src/main.rs" | ||
|
||
[features] | ||
default = [] # No features enabled by default | ||
binaries = [] | ||
|
||
[dependencies] | ||
clap = "4.5.27" | ||
log = "0.4.25" | ||
ctor = "0.2.9" | ||
tracing = "0.1.41" | ||
tracing-subscriber = "0.3.19" | ||
|
||
[dev-dependencies] | ||
criterion = { version = "0.5", features = ["html_reports"] } | ||
|
||
[[bench]] | ||
name = "project_benchmarks" | ||
harness = false | ||
|
||
[profile.release] | ||
strip = "symbols" | ||
codegen-units = 1 | ||
lto = true | ||
|
||
[dev-dependencies] | ||
[profile.bench] | ||
debug = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
|
||
fn benchmark_fun(_c: &mut Criterion) { | ||
// Your benchmarking code here | ||
} | ||
|
||
criterion_group!(benches, benchmark_fun,); | ||
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pub mod cli; | ||
pub mod logging; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use ctor::ctor; | ||
use tracing::Level; | ||
use tracing_subscriber; | ||
|
||
#[ctor] | ||
fn set_debug_level() { | ||
// If DEBUG_PROJ is not set or set to false, disable logging. Otherwise, enable logging | ||
if std::env::var("DEBUG_PROJ").map_or(true, |v| v == "0" || v == "false" || v.is_empty()) { | ||
// Disable logging | ||
} else { | ||
tracing_subscriber::fmt() | ||
.with_max_level(Level::DEBUG) | ||
.init(); | ||
} | ||
|
||
//println!("DEBUG_PROJ: {:?}", std::env::var("DEBUG_PROJ")); | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|