-
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.
Add runtime/compile time env. var. config/usage
- Loading branch information
1 parent
2499538
commit 1827497
Showing
6 changed files
with
48 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"rust-analyzer.linkedProjects": [ | ||
"./Cargo.toml" | ||
], | ||
"rust-analyzer.showUnlinkedFileNotification": false | ||
} |
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 |
---|---|---|
|
@@ -56,6 +56,18 @@ clap = "4.0.32" | |
[features] | ||
foo = [] # feature has no explicit dependencies | ||
|
||
# Todo: how to use them? | ||
# Compile time env. vars | ||
# To use at runtime, ss .cargo/config.toml | ||
[env] | ||
RUST_BACKTRACE="1" | ||
AA=1 | ||
BB=true | ||
FOO = "bar" | ||
XX = 42 | ||
PATH_TO_SOME_TOOL = { value = "bin/tool", relative = true } | ||
USERNAME = { value = "test_user", force = true } | ||
|
||
# # All workspace members should inherit these keys for package declarations. | ||
# [workspace.package] | ||
# authors = ["Aptos Labs <[email protected]>"] | ||
|
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,11 @@ | ||
|
||
// Run time env. vars use | ||
// .cargo/config.toml | ||
// [env] | ||
// ... | ||
// see main.rs for usage | ||
|
||
// Todo | ||
// Compile time env. vars use | ||
// Cargo.toml | ||
// [env] |
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 |
---|---|---|
|
@@ -5,3 +5,9 @@ | |
// assert_eq!(32, 32); | ||
// } | ||
|
||
|
||
#[test] | ||
fn ex1_ww() { | ||
// println!("xx: {:?}", xx); | ||
assert_eq!(42, 42); | ||
} |