diff --git a/technology/programming/languages/Rust.md b/technology/programming/languages/Rust.md index 8a64be8..d03a0e8 100644 --- a/technology/programming/languages/Rust.md +++ b/technology/programming/languages/Rust.md @@ -71,7 +71,7 @@ Rust enforces some rules on variables in order to be memory safe. So there are t - Reference `&T`: You have a read only reference of the variables content - Mutable Reference `&mut T`: You have a modifiable reference to the variable -> Note: If the function does not need to mutate or own a variable, consider using a reference +> Note: If a function does not need to mutate or own a variable, consider using a reference ### Conditionals Conditionals like `if` and `match` can be used, while `match` can do more powerful pattern matching than `if`. @@ -140,7 +140,7 @@ match err_response { StatusCode::Err(err) => println!("Some error: {err}"); // will print "Some error: Internal Error" } -/// other way to pattern match for a single pattern +// other way to pattern match for a single pattern if let StatusCode::Err(msg) = err_response { println!("{msg}!"); }