Compare commits

...

2 Commits

Author SHA1 Message Date
Reed Krantz
95c9a3f192 feat(rust): add a manifest variable that contains the Cargo.toml values 2026-02-21 15:45:21 -06:00
Reed Krantz
c822e1d2eb style(rust): fixed formating in main 2026-02-21 15:44:22 -06:00
2 changed files with 11 additions and 3 deletions

View File

@@ -27,9 +27,14 @@
systems = ["aarch64-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin"]; systems = ["aarch64-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin"];
perSystem = {pkgs, ...}: let perSystem = {
pkgs,
lib,
...
}: let
craneLib = crane.mkLib pkgs; craneLib = crane.mkLib pkgs;
src = craneLib.cleanCargoSource ./.; src = craneLib.cleanCargoSource ./.;
manifest = (lib.importTOML "${src}/Cargo.toml").package;
# runtime dependencies # runtime dependencies
buildInputs = with pkgs; [ buildInputs = with pkgs; [
@@ -66,7 +71,7 @@
programs.alejandra.enable = true; programs.alejandra.enable = true;
programs.rustfmt = { programs.rustfmt = {
enable = true; enable = true;
edition = (builtins.fromTOML (builtins.readFile "${src}/Cargo.toml")).package.edition; edition = manifest.edition;
}; };
}; };

View File

@@ -60,7 +60,10 @@ async fn main() -> Result<(), CommandError> {
} }
}; };
println!("{}", CommandError::InvalidArgument(ArgsError::InvalidConfigExtension(Some(String::from("txt"))))); println!(
"{}",
CommandError::InvalidArgument(ArgsError::InvalidConfigExtension(Some(String::from("txt"))))
);
Ok(()) Ok(())
} }