Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Tasks/Conflicts/code_scenario3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ fn main() {
let input = &args[1]; // The input string to be parsed

// Try parsing input as i32
if let Ok(value) = input.parse::<i32>() {
println!("{value} is of type i32: {} bytes", mem::size_of::<i32>());
print_other_types("i32");
}
// Try parsing input as u32
else if let Ok(value) = input.parse::<u32>() {
if let Ok(value) = input.parse::<u32>() {
println!("{value} is of type u32: {} bytes", mem::size_of::<u32>());
print_other_types("u32");
}
// Try parsing input as u32
else if let Ok(value) = input.parse::<i32>() {
println!("{value} is of type i32: {} bytes", mem::size_of::<i32>());
print_other_types("i32");
}
// Try parsing input as f64
else if let Ok(value) = input.parse::<f64>() {
println!("{value} is of type f64: {} bytes", mem::size_of::<f64>());
Expand Down