Skip to content

Commit

Permalink
Early drop of command locks
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed <>
  • Loading branch information
Ahmed authored and oddcoder committed Sep 22, 2024
1 parent d0cb8ed commit 1f0d873
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ impl Core {
let cmds = self.commands.clone();
let cmds_ref = cmds.lock();
let cmd = cmds_ref.find(command);
drop(cmds_ref);
if let Some(cmd) = cmd {
cmd.lock().run(self, args);
} else {
drop(cmds_ref);
self.command_not_found(command);
}
}
Expand Down

0 comments on commit 1f0d873

Please sign in to comment.