diff --git a/src/fs/copy.rs b/src/fs/copy.rs index f817d6a..bb3316e 100644 --- a/src/fs/copy.rs +++ b/src/fs/copy.rs @@ -32,7 +32,7 @@ use crate::task::blocking; /// # /// use async_std::fs; /// -/// let bytes_copied = fs::copy("foo.txt", "bar.txt").await?; +/// let bytes_copied = fs::copy("a.txt", "b.txt").await?; /// # /// # Ok(()) }) } /// ``` diff --git a/src/fs/file.rs b/src/fs/file.rs index d84f098..6f6b898 100644 --- a/src/fs/file.rs +++ b/src/fs/file.rs @@ -39,7 +39,7 @@ use crate::task::{blocking, Context, Poll}; /// use async_std::fs::File; /// use async_std::prelude::*; /// -/// let mut file = File::create("foo.txt").await?; +/// let mut file = File::create("a.txt").await?; /// file.write_all(b"Hello, world!").await?; /// # /// # Ok(()) }) } @@ -54,7 +54,7 @@ use crate::task::{blocking, Context, Poll}; /// use async_std::fs::File; /// use async_std::prelude::*; /// -/// let mut file = File::open("foo.txt").await?; +/// let mut file = File::open("a.txt").await?; /// let mut contents = Vec::new(); /// file.read_to_end(&mut contents).await?; /// # @@ -129,7 +129,7 @@ impl File { /// # /// use async_std::fs::File; /// - /// let file = File::open("foo.txt").await?; + /// let file = File::open("a.txt").await?; /// # /// # Ok(()) }) } /// ``` @@ -176,7 +176,7 @@ impl File { /// # /// use async_std::fs::File; /// - /// let file = File::create("foo.txt").await?; + /// let file = File::create("a.txt").await?; /// # /// # Ok(()) }) } /// ``` @@ -224,7 +224,7 @@ impl File { /// use async_std::fs::File; /// use async_std::prelude::*; /// - /// let mut file = File::create("foo.txt").await?; + /// let mut file = File::create("a.txt").await?; /// file.write_all(b"Hello, world!").await?; /// file.sync_all().await?; /// # @@ -280,7 +280,7 @@ impl File { /// use async_std::fs::File; /// use async_std::prelude::*; /// - /// let mut file = File::create("foo.txt").await?; + /// let mut file = File::create("a.txt").await?; /// file.write_all(b"Hello, world!").await?; /// file.sync_data().await?; /// # @@ -340,7 +340,7 @@ impl File { /// use async_std::fs::File; /// use async_std::prelude::*; /// - /// let mut file = File::create("foo.txt").await?; + /// let mut file = File::create("a.txt").await?; /// file.set_len(10).await?; /// # /// # Ok(()) }) } @@ -387,7 +387,7 @@ impl File { /// # /// use async_std::fs::File; /// - /// let file = File::open("foo.txt").await?; + /// let file = File::open("a.txt").await?; /// let metadata = file.metadata().await?; /// # /// # Ok(()) }) } @@ -440,7 +440,7 @@ impl File { /// use async_std::fs::File; /// use async_std::prelude::*; /// - /// let mut file = File::create("foo.txt").await?; + /// let mut file = File::create("a.txt").await?; /// let mut perms = file.metadata().await?.permissions(); /// perms.set_readonly(true); /// file.set_permissions(perms).await?; diff --git a/src/fs/metadata.rs b/src/fs/metadata.rs index 066be3c..67ab620 100644 --- a/src/fs/metadata.rs +++ b/src/fs/metadata.rs @@ -27,7 +27,7 @@ use crate::task::blocking; /// # /// use async_std::fs; /// -/// let perm = fs::metadata("foo.txt").await?.permissions(); +/// let perm = fs::metadata("a.txt").await?.permissions(); /// # /// # Ok(()) }) } /// ``` diff --git a/src/fs/mod.rs b/src/fs/mod.rs index 1c7f3fe..28b55b8 100644 --- a/src/fs/mod.rs +++ b/src/fs/mod.rs @@ -15,7 +15,7 @@ //! use async_std::fs::File; //! use async_std::prelude::*; //! -//! let mut file = File::create("foo.txt").await?; +//! let mut file = File::create("a.txt").await?; //! file.write_all(b"Hello, world!").await?; //! # //! # Ok(()) }) } diff --git a/src/fs/open_options.rs b/src/fs/open_options.rs index 1ac3dbe..72ce24c 100644 --- a/src/fs/open_options.rs +++ b/src/fs/open_options.rs @@ -39,7 +39,7 @@ use crate::task::blocking; /// /// let file = OpenOptions::new() /// .read(true) -/// .open("foo.txt") +/// .open("a.txt") /// .await?; /// # /// # Ok(()) }) } @@ -57,7 +57,7 @@ use crate::task::blocking; /// .read(true) /// .write(true) /// .create(true) -/// .open("foo.txt") +/// .open("a.txt") /// .await?; /// # /// # Ok(()) }) } @@ -80,7 +80,7 @@ impl OpenOptions { /// /// let file = OpenOptions::new() /// .read(true) - /// .open("foo.txt") + /// .open("a.txt") /// .await?; /// # /// # Ok(()) }) } @@ -103,7 +103,7 @@ impl OpenOptions { /// /// let file = OpenOptions::new() /// .read(true) - /// .open("foo.txt") + /// .open("a.txt") /// .await?; /// # /// # Ok(()) }) } @@ -130,7 +130,7 @@ impl OpenOptions { /// /// let file = OpenOptions::new() /// .write(true) - /// .open("foo.txt") + /// .open("a.txt") /// .await?; /// # /// # Ok(()) }) } @@ -176,7 +176,7 @@ impl OpenOptions { /// /// let file = OpenOptions::new() /// .append(true) - /// .open("foo.txt") + /// .open("a.txt") /// .await?; /// # /// # Ok(()) }) } @@ -204,7 +204,7 @@ impl OpenOptions { /// let file = OpenOptions::new() /// .write(true) /// .truncate(true) - /// .open("foo.txt") + /// .open("a.txt") /// .await?; /// # /// # Ok(()) }) } @@ -234,7 +234,7 @@ impl OpenOptions { /// let file = OpenOptions::new() /// .write(true) /// .create(true) - /// .open("foo.txt") + /// .open("a.txt") /// .await?; /// # /// # Ok(()) }) } @@ -271,7 +271,7 @@ impl OpenOptions { /// let file = OpenOptions::new() /// .write(true) /// .create_new(true) - /// .open("foo.txt") + /// .open("a.txt") /// .await?; /// # /// # Ok(()) }) } @@ -321,7 +321,7 @@ impl OpenOptions { /// # /// use async_std::fs::OpenOptions; /// - /// let file = OpenOptions::new().open("foo.txt").await?; + /// let file = OpenOptions::new().open("a.txt").await?; /// # /// # Ok(()) }) } /// ``` diff --git a/src/fs/read.rs b/src/fs/read.rs index f7aabe0..ba79d50 100644 --- a/src/fs/read.rs +++ b/src/fs/read.rs @@ -29,7 +29,7 @@ use crate::task::blocking; /// # /// use async_std::fs; /// -/// let contents = fs::read("foo.txt").await?; +/// let contents = fs::read("a.txt").await?; /// # /// # Ok(()) }) } /// ``` diff --git a/src/fs/read_link.rs b/src/fs/read_link.rs index aa9cbcb..0612b28 100644 --- a/src/fs/read_link.rs +++ b/src/fs/read_link.rs @@ -25,7 +25,7 @@ use crate::task::blocking; /// # /// use async_std::fs; /// -/// let path = fs::read_link("foo.txt").await?; +/// let path = fs::read_link("a.txt").await?; /// # /// # Ok(()) }) } /// ``` diff --git a/src/fs/read_to_string.rs b/src/fs/read_to_string.rs index 6bd1a7c..2f771fa 100644 --- a/src/fs/read_to_string.rs +++ b/src/fs/read_to_string.rs @@ -24,7 +24,7 @@ use crate::task::blocking; /// use async_std::fs::read_to_string; /// /// # futures::executor::block_on(async { -/// let contents = read_to_string("foo.txt").await?; +/// let contents = read_to_string("a.txt").await?; /// # std::io::Result::Ok(()) /// # }).unwrap(); /// ``` diff --git a/src/fs/remove_file.rs b/src/fs/remove_file.rs index 4463250..4e691a2 100644 --- a/src/fs/remove_file.rs +++ b/src/fs/remove_file.rs @@ -25,7 +25,7 @@ use crate::task::blocking; /// # /// use async_std::fs; /// -/// fs::remove_file("foo.txt").await?; +/// fs::remove_file("a.txt").await?; /// # /// # Ok(()) }) } /// ``` diff --git a/src/fs/set_permissions.rs b/src/fs/set_permissions.rs index ed61d19..e5e1c2a 100644 --- a/src/fs/set_permissions.rs +++ b/src/fs/set_permissions.rs @@ -25,10 +25,10 @@ use crate::task::blocking; /// # /// use async_std::fs; /// -/// let mut perm = fs::metadata("foo.txt").await?.permissions(); +/// let mut perm = fs::metadata("a.txt").await?.permissions(); /// perm.set_readonly(true); /// -/// fs::set_permissions("foo.txt", perm).await?; +/// fs::set_permissions("a.txt", perm).await?; /// # /// # Ok(()) }) } /// ``` diff --git a/src/fs/symlink_metadata.rs b/src/fs/symlink_metadata.rs index 43d8ea2..1c34bb9 100644 --- a/src/fs/symlink_metadata.rs +++ b/src/fs/symlink_metadata.rs @@ -25,7 +25,7 @@ use crate::task::blocking; /// # /// use async_std::fs; /// -/// let perm = fs::symlink_metadata("foo.txt").await?.permissions(); +/// let perm = fs::symlink_metadata("a.txt").await?.permissions(); /// # /// # Ok(()) }) } /// ``` diff --git a/src/fs/write.rs b/src/fs/write.rs index 693f95a..83a1938 100644 --- a/src/fs/write.rs +++ b/src/fs/write.rs @@ -27,7 +27,7 @@ use crate::task::blocking; /// # /// use async_std::fs; /// -/// fs::write("foo.txt", b"Lorem ipsum").await?; +/// fs::write("a.txt", b"Lorem ipsum").await?; /// # /// # Ok(()) }) } /// ``` diff --git a/src/lib.rs b/src/lib.rs index 387bdf2..ceb58a9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -//! Asynchronous standard library. +//! Async version of the Rust standard library. //! //! This crate is an async version of [`std`]. //! diff --git a/src/task/local.rs b/src/task/local.rs index 01062c3..f853a83 100644 --- a/src/task/local.rs +++ b/src/task/local.rs @@ -94,11 +94,11 @@ impl LocalKey { /// use std::cell::Cell; /// /// task_local! { - /// static FOO: Cell = Cell::new(5); + /// static NUMBER: Cell = Cell::new(5); /// } /// /// task::block_on(async { - /// let v = FOO.with(|c| c.get()); + /// let v = NUMBER.with(|c| c.get()); /// assert_eq!(v, 5); /// }); /// ``` diff --git a/tests/block_on.rs b/tests/block_on.rs index baa1240..7c6a316 100644 --- a/tests/block_on.rs +++ b/tests/block_on.rs @@ -9,10 +9,10 @@ fn smoke() { } #[test] -#[should_panic = "foo"] +#[should_panic = "boom"] fn panic() { task::block_on(async { // This panic should get propagated into the parent thread. - panic!("foo"); + panic!("boom"); }); }