Skip to content

Commit 447b31c

Browse files
authored
Remove type annotations from borrowck example (#2791)
These slides are on day 3, I don't think we need the explicit type annotations at this point.
1 parent 2e50843 commit 447b31c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/borrowing/borrowck.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ rule. For a given value, at any time:
2929

3030
```rust,editable,compile_fail
3131
fn main() {
32-
let mut a: i32 = 10;
33-
let b: &i32 = &a;
32+
let mut a = 10;
33+
let b = &a;
3434
3535
{
36-
let c: &mut i32 = &mut a;
36+
let c = &mut a;
3737
*c = 20;
3838
}
3939

src/lifetimes/lifetime-annotations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ fn left_most(p1: &Point, p2: &Point) -> &Point {
3333
}
3434
3535
fn main() {
36-
let p1: Point = Point(10, 10);
37-
let p2: Point = Point(20, 20);
36+
let p1 = Point(10, 10);
37+
let p2 = Point(20, 20);
3838
let p3 = left_most(&p1, &p2); // What is the lifetime of p3?
3939
dbg!(p3);
4040
}

0 commit comments

Comments
 (0)