Skip to content

Commit

Permalink
Renamed function to make intent clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
rben01 committed Dec 4, 2024
1 parent ff33886 commit 73fc799
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion numbat-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ impl Cli {

rl.add_history_entry(&line)?;

match cmd_runner.run_command(
match cmd_runner.try_run_command(
&line,
CommandContext {
ctx: self.context.lock().unwrap(),
Expand Down
4 changes: 2 additions & 2 deletions numbat/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ impl<Editor> CommandRunner<Editor> {
/// `CommandControlFlow::Continue` or `CommandControlFlow::Return`. If the line is
/// not an enabled command (whether that's because it's not a command at all, or
/// it's a disabled command), then this returns `CommandControlFlow::NotACommand`.
pub fn run_command<ContextMut: DerefMut<Target = Context>>(
pub fn try_run_command<ContextMut: DerefMut<Target = Context>>(
&self,
line: &str,
mut args: CommandContext<ContextMut, Editor>,
Expand Down Expand Up @@ -815,7 +815,7 @@ mod test {
ctx,
editor: &mut (),
};
assert_eq!(expected, runner.run_command(input, args).unwrap());
assert_eq!(expected, runner.try_run_command(input, args).unwrap());
}

let mut ctx = Context::new_without_importer();
Expand Down

0 comments on commit 73fc799

Please sign in to comment.