1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-06 00:44:23 +02:00

Remove two unnecessary muts from the Rc example (#1603)

Neither `a` nor `b` need to be mutable in this example. Hence, I removed
them.
This commit is contained in:
Martin Huschenbett 2023-12-20 16:47:35 +01:00 committed by GitHub
parent a369e108fc
commit 568e78a5b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,8 +11,8 @@ to the same data from multiple places:
use std::rc::Rc;
fn main() {
let mut a = Rc::new(10);
let mut b = Rc::clone(&a);
let a = Rc::new(10);
let b = Rc::clone(&a);
println!("a: {a}");
println!("b: {b}");