diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-09-23 17:20:36 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-09-25 14:27:42 -0700 |
| commit | 3585c64d092082ab2aa16a6d674d063c5d68e1a8 (patch) | |
| tree | 0474a6b6ae66322964afdef0ddff18c5af3ef73f /src/libstd/rt/io | |
| parent | db28c2998015446dd4f3c9615484f0666225aa60 (diff) | |
| download | rust-3585c64d092082ab2aa16a6d674d063c5d68e1a8.tar.gz rust-3585c64d092082ab2aa16a6d674d063c5d68e1a8.zip | |
rustdoc: Change all code-blocks with a script
find src -name '*.rs' | xargs sed -i '' 's/~~~.*{\.rust}/```rust/g'
find src -name '*.rs' | xargs sed -i '' 's/ ~~~$/ ```/g'
find src -name '*.rs' | xargs sed -i '' 's/^~~~$/ ```/g'
Diffstat (limited to 'src/libstd/rt/io')
| -rw-r--r-- | src/libstd/rt/io/buffered.rs | 12 | ||||
| -rw-r--r-- | src/libstd/rt/io/file.rs | 18 | ||||
| -rw-r--r-- | src/libstd/rt/io/mock.rs | 2 |
3 files changed, 16 insertions, 16 deletions
diff --git a/src/libstd/rt/io/buffered.rs b/src/libstd/rt/io/buffered.rs index 7988f640687..3e801f28991 100644 --- a/src/libstd/rt/io/buffered.rs +++ b/src/libstd/rt/io/buffered.rs @@ -17,7 +17,7 @@ //! //! # Examples //! -//! ~~~ +//! ``` //! let tcp_stream = TcpStream::connect(addr); //! let reader = BufferedReader::new(tcp_stream); //! @@ -26,17 +26,17 @@ //! Some(nread) => println!("Read {} bytes", nread), //! None => println!("At the end of the stream!") //! } -//! ~~~ +//! ``` //! -//! ~~~ +//! ``` //! let tcp_stream = TcpStream::connect(addr); //! let writer = BufferedWriter::new(tcp_stream); //! //! writer.write("hello, world".as_bytes()); //! writer.flush(); -//! ~~~ +//! ``` //! -//! ~~~ +//! ``` //! let tcp_stream = TcpStream::connect(addr); //! let stream = BufferedStream::new(tcp_stream); //! @@ -48,7 +48,7 @@ //! Some(nread) => println!("Read {} bytes", nread), //! None => println!("At the end of the stream!") //! } -//! ~~~ +//! ``` //! use prelude::*; diff --git a/src/libstd/rt/io/file.rs b/src/libstd/rt/io/file.rs index 2206f8bf6ae..b11ee014af9 100644 --- a/src/libstd/rt/io/file.rs +++ b/src/libstd/rt/io/file.rs @@ -477,7 +477,7 @@ pub trait FileSystemInfo { /// /// * Check if a file exists, reading from it if so /// -/// ~~~{.rust} +/// ```rust /// use std; /// use std::path::Path; /// use std::rt::io::file::{FileInfo, FileReader}; @@ -489,17 +489,17 @@ pub trait FileSystemInfo { /// reader.read(mem); /// // ... /// } -/// ~~~ +/// ``` /// /// * Is the given path a file? /// -/// ~~~{.rust} +/// ```rust /// let f = get_file_path_from_wherever(); /// match f.is_file() { /// true => doing_something_with_a_file(f), /// _ => {} /// } -/// ~~~ +/// ``` pub trait FileInfo : FileSystemInfo { /// Whether the underlying implemention (be it a file path, /// or something else) points at a "regular file" on the FS. Will return @@ -574,7 +574,7 @@ impl FileInfo for Path { } /// /// * Check if a directory exists, `mkdir`'ing it if not /// -/// ~~~{.rust} +/// ```rust /// use std; /// use std::path::Path; /// use std::rt::io::file::{DirectoryInfo}; @@ -583,11 +583,11 @@ impl FileInfo for Path { } /// if !dir.exists() { /// dir.mkdir(); /// } -/// ~~~ +/// ``` /// /// * Is the given path a directory? If so, iterate on its contents /// -/// ~~~{.rust} +/// ```rust /// fn visit_dirs(dir: &Path, cb: &fn(&Path)) { /// if dir.is_dir() { /// let contents = dir.readdir(); @@ -598,7 +598,7 @@ impl FileInfo for Path { } /// } /// else { fail!("nope"); } /// } -/// ~~~ +/// ``` trait DirectoryInfo : FileSystemInfo { /// Whether the underlying implemention (be it a file path, /// or something else) is pointing at a directory in the underlying FS. @@ -971,4 +971,4 @@ mod test { dir.rmdir(); } } -} \ No newline at end of file +} diff --git a/src/libstd/rt/io/mock.rs b/src/libstd/rt/io/mock.rs index b580b752bd9..c46e1372c64 100644 --- a/src/libstd/rt/io/mock.rs +++ b/src/libstd/rt/io/mock.rs @@ -47,4 +47,4 @@ impl MockWriter { impl Writer for MockWriter { fn write(&mut self, buf: &[u8]) { (self.write)(buf) } fn flush(&mut self) { (self.flush)() } -} \ No newline at end of file +} |
