diff --git a/nostarch/chapter04.md b/nostarch/chapter04.md index 16753d8..74e142b 100644 --- a/nostarch/chapter04.md +++ b/nostarch/chapter04.md @@ -580,7 +580,7 @@ fn change(some_string: &String) { Here’s the error: -```text +```bash error: cannot borrow immutable borrowed content `*some_string` as mutable --> error.rs:8:5 | @@ -622,7 +622,7 @@ let r2 = &mut s; Here’s the error: -```text +```bash error[E0499]: cannot borrow `s` as mutable more than once at a time --> borrow_twice.rs:5:19 | @@ -666,7 +666,7 @@ let r3 = &mut s; // BIG PROBLEM Here’s the error: -```text +```bash error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immutable --> borrow_thrice.rs:6:19 | @@ -707,7 +707,7 @@ fn dangle() -> &String { Here’s the error: -```text +```bash error[E0106]: missing lifetime specifier --> dangle.rs:5:16 | @@ -725,7 +725,7 @@ This error message refers to a feature we haven’t learned about yet, ‘lifetimes’. The message does contain the key to why this code is a problem, though: -```text +```bash this function’s return type contains a borrowed value, but there is no value for it to be borrowed from ``` diff --git a/src/ch04-02-references-and-borrowing.md b/src/ch04-02-references-and-borrowing.md index 6c0f3d8..d24226e 100644 --- a/src/ch04-02-references-and-borrowing.md +++ b/src/ch04-02-references-and-borrowing.md @@ -106,7 +106,7 @@ fn change(some_string: &String) { Here’s the error: -```text +```bash error: cannot borrow immutable borrowed content `*some_string` as mutable --> error.rs:8:5 | @@ -148,7 +148,7 @@ let r2 = &mut s; Here’s the error: -```text +```bash error[E0499]: cannot borrow `s` as mutable more than once at a time --> borrow_twice.rs:5:19 | @@ -192,7 +192,7 @@ let r3 = &mut s; // BIG PROBLEM Here’s the error: -```text +```bash error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immutable --> borrow_thrice.rs:6:19 | @@ -233,7 +233,7 @@ fn dangle() -> &String { Here’s the error: -```text +```bash error[E0106]: missing lifetime specifier --> dangle.rs:5:16 | @@ -251,7 +251,7 @@ This error message refers to a feature we haven’t learned about yet, ‘lifetimes’. The message does contain the key to why this code is a problem, though: -```text +```bash this function’s return type contains a borrowed value, but there is no value for it to be borrowed from ```