about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThomas Karpiniec <tk@1.21jiggawatts.net>2015-05-25 18:38:17 +1000
committerThomas Karpiniec <tk@1.21jiggawatts.net>2015-05-25 18:38:17 +1000
commit2b3354cbf8cc8eba08cceeda3deb615d6329185f (patch)
tree721e0b84f15bc2e1175553e7af313c4922ba5200
parent49597fcbf26736ac2b2f7d6beab27f42a44bf306 (diff)
downloadrust-2b3354cbf8cc8eba08cceeda3deb615d6329185f.tar.gz
rust-2b3354cbf8cc8eba08cceeda3deb615d6329185f.zip
book: add no_run and use statement to strings no-coercion example
-rw-r--r--src/doc/trpl/strings.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/doc/trpl/strings.md b/src/doc/trpl/strings.md
index 656b9d49126..55154036286 100644
--- a/src/doc/trpl/strings.md
+++ b/src/doc/trpl/strings.md
@@ -54,7 +54,9 @@ instead of `&str`. For example, [`TcpStream::connect`][connect] has a parameter
 of type `ToSocketAddrs`. A `&str` is okay but a `String` must be explicitly
 converted using `&*`.
 
-```rust
+```rust,no_run
+use std::net::TcpStream;
+
 TcpStream::connect("192.168.0.1:3000"); // &str parameter
 
 let addr_string = "192.168.0.1:3000".to_string();