-
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.
feat: move var setting in args to macro, add justfile (#20)
- Loading branch information
Showing
5 changed files
with
35 additions
and
20 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,4 +1,5 @@ | ||
mod internal; | ||
pub mod macros; | ||
mod mandep; | ||
mod opts; | ||
|
||
|
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,13 @@ | ||
#[macro_export] | ||
macro_rules! set_vars { | ||
($target:expr, $name:literal, $value:expr) => { | ||
for arg in &mut *$target { | ||
*arg = arg.replace(concat!("${", $name, "}"), $value); | ||
} | ||
}; | ||
($target:expr, { $($name:literal => $value:expr,)* }) => { | ||
for arg in &mut *$target { | ||
$(*arg = arg.replace(concat!("${", $name, "}"), $value);)* | ||
} | ||
}; | ||
} |
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 @@ | ||
fmt: | ||
cargo +nightly fmt --all | ||
|
||
lint: | ||
cargo clippy --all-targets --all-features -- -D warnings | ||
cargo +nightly fmt --all -- --check |