calling it run()

This commit is contained in:
kevin zhao
2025-11-19 20:37:44 +00:00
parent 9ec2873084
commit b6cd0a5f02
3 changed files with 3 additions and 3 deletions

View File

@@ -329,7 +329,7 @@ fn run_update_action(action: UpdateAction) -> anyhow::Result<()> {
}
fn run_execpolicy_check(cli: ExecPolicyCheckCommand) -> anyhow::Result<()> {
let json = cli.to_json()?;
let json = cli.run()?;
println!("{json}");
Ok(())
}

View File

@@ -32,7 +32,7 @@ pub struct ExecPolicyCheckCommand {
impl ExecPolicyCheckCommand {
/// Load the policies for this command, evaluate the command, and render JSON output.
pub fn to_json(&self) -> Result<String> {
pub fn run(&self) -> Result<String> {
let policy = load_policies(&self.policies)?;
let evaluation = policy.check(&self.command);

View File

@@ -18,7 +18,7 @@ fn main() -> Result<()> {
}
fn cmd_check(cmd: ExecPolicyCheckCommand) -> Result<()> {
let json = cmd.to_json()?;
let json = cmd.run()?;
println!("{json}");
Ok(())
}