Skip to content

Commit

Permalink
fix cspell
Browse files Browse the repository at this point in the history
  • Loading branch information
tjjfvi committed Feb 27, 2024
1 parent 0a8211b commit 45a202e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ fn run(host: &Host, opts: RuntimeOpts, args: RunArgs) {
/// doesn't fail on 32-bit systems. We want it to fail later on, when attempting
/// to run the program.
fn mem_parser(arg: &str) -> Result<u64, String> {
let (base, mult) = match arg.to_lowercase().chars().last() {
let (base, scale) = match arg.to_lowercase().chars().last() {
None => return Err("Mem size argument is empty".to_string()),
Some('k') => (&arg[0 .. arg.len() - 1], 1 << 10),
Some('m') => (&arg[0 .. arg.len() - 1], 1 << 20),
Some('g') => (&arg[0 .. arg.len() - 1], 1 << 30),
Some(_) => (arg, 1),
};
let base = base.parse::<u64>().map_err(|e| e.to_string())?;
Ok(base * mult)
Ok(base * scale)
}

fn load_files(files: &[String]) -> Arc<Mutex<Host>> {
Expand Down

0 comments on commit 45a202e

Please sign in to comment.