mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-11 21:29:18 +00:00
error fix
- fixed the `Option` condition - fixed the `swap` value
This commit is contained in:
parent
c5898ac6b7
commit
5213705265
@ -6,7 +6,7 @@
|
||||
#[allow(unused_variables, unused_assignments)]
|
||||
fn main() {
|
||||
let my_option: Option<()> = None;
|
||||
if my_option.is_none() {
|
||||
if !my_option.is_none() {
|
||||
my_option.unwrap();
|
||||
}
|
||||
|
||||
@ -22,7 +22,8 @@ fn main() {
|
||||
let mut value_a = 45;
|
||||
let mut value_b = 66;
|
||||
// Let's swap these two!
|
||||
let temp_a = value_a;
|
||||
value_a = value_b;
|
||||
value_b = value_a;
|
||||
value_b = temp_a;
|
||||
println!("value a: {}; value b: {}", value_a, value_b);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user