Skip to content

Commit

Permalink
Very small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
LuMarans30 committed Jul 21, 2024
1 parent 3d290c1 commit d6082b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ pub fn decimal_to_binary_lookup(dec: &BigUint) -> String {
let trimmed: String = result.into_iter().rev().skip_while(|&c| c == '0').collect();

if trimmed.is_empty() {
"0".to_string()
} else {
trimmed
return "0".to_string();
}

trimmed
}
6 changes: 1 addition & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ fn main() -> io::Result<()> {

loop {
//Menu options for the user
println!("\n1. Iterative method");
println!("2. Recursive method");
println!("3. Lookup table method (fastest method)");
println!("4. Exit");
print!("Choose a method (1-4): ");
print!("\n1. Iterative method\n2. Recursive method\n3. Lookup table method (fastest method)\n4. Exit\nChoose a method (1-4): ");

io::stdout().flush()?;

Expand Down

0 comments on commit d6082b7

Please sign in to comment.