diff --git a/src/doc/trpl/traits.md b/src/doc/trpl/traits.md index 889205ad5d8b..d22c9cba0826 100644 --- a/src/doc/trpl/traits.md +++ b/src/doc/trpl/traits.md @@ -192,8 +192,8 @@ Here’s the error: ```text error: type `std::fs::File` does not implement any method in scope named `write` -let result = f.write(b"whatever"); - ^~~~~~~~~~~~~~~~~~ +let result = f.write("whatever".as_bytes()); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` We need to `use` the `Write` trait first: