diff --git a/src/borrowing/borrowck.md b/src/borrowing/borrowck.md index 993dd4ba..3c964999 100644 --- a/src/borrowing/borrowck.md +++ b/src/borrowing/borrowck.md @@ -29,11 +29,11 @@ rule. For a given value, at any time: ```rust,editable,compile_fail fn main() { - let mut a: i32 = 10; - let b: &i32 = &a; + let mut a = 10; + let b = &a; { - let c: &mut i32 = &mut a; + let c = &mut a; *c = 20; } diff --git a/src/lifetimes/lifetime-annotations.md b/src/lifetimes/lifetime-annotations.md index b80ff854..35b88bc9 100644 --- a/src/lifetimes/lifetime-annotations.md +++ b/src/lifetimes/lifetime-annotations.md @@ -33,8 +33,8 @@ fn left_most(p1: &Point, p2: &Point) -> &Point { } fn main() { - let p1: Point = Point(10, 10); - let p2: Point = Point(20, 20); + let p1 = Point(10, 10); + let p2 = Point(20, 20); let p3 = left_most(&p1, &p2); // What is the lifetime of p3? dbg!(p3); }