linting and fmt

This commit is contained in:
timurgordon
2025-06-19 02:32:56 +03:00
parent 4e717bc054
commit 1a3fa6242d
24 changed files with 1024 additions and 620 deletions

View File

@@ -57,7 +57,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
log::error!("Failed to read script file '{}': {}", script_path_str, e);
// Attempt to read from an alternative path if run via `cargo run --example`
// where current dir might be the crate root.
let alt_script_path = Path::new(file!()).parent().unwrap().join("auth_script.rhai");
let alt_script_path = Path::new(file!())
.parent()
.unwrap()
.join("auth_script.rhai");
log::info!("Attempting alternative script path: {:?}", alt_script_path);
fs::read_to_string(&alt_script_path)?
}
@@ -106,9 +109,15 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
);
// Basic assertion for expected output
if caller_pk == "admin_pk" {
assert_eq!(details.output, Some("Access Granted: Welcome Admin!".to_string()));
assert_eq!(
details.output,
Some("Access Granted: Welcome Admin!".to_string())
);
} else if caller_pk == "user_pk" {
assert_eq!(details.output, Some("Limited Access: Welcome User!".to_string()));
assert_eq!(
details.output,
Some("Limited Access: Welcome User!".to_string())
);
}
}
Err(e) => {