Skip to content

Commit

Permalink
Fix more rustdoc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn committed Oct 24, 2023
1 parent 75d93a4 commit 558e767
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 64 deletions.
4 changes: 1 addition & 3 deletions tokio/src/fs/canonicalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ use std::path::{Path, PathBuf};
/// Returns the canonical, absolute form of a path with all intermediate
/// components normalized and symbolic links resolved.
///
/// This is an async version of [`std::fs::canonicalize`][std]
///
/// [std]: std::fs::canonicalize
/// This is an async version of [`std::fs::canonicalize`].
///
/// # Platform-specific behavior
///
Expand Down
4 changes: 1 addition & 3 deletions tokio/src/fs/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use std::path::Path;
/// of the original file to the destination file.
/// This function will overwrite the contents of to.
///
/// This is the async equivalent of [`std::fs::copy`][std].
///
/// [std]: fn@std::fs::copy
/// This is the async equivalent of [`std::fs::copy`].
///
/// # Examples
///
Expand Down
4 changes: 1 addition & 3 deletions tokio/src/fs/create_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use std::path::Path;

/// Creates a new, empty directory at the provided path.
///
/// This is an async version of [`std::fs::create_dir`][std]
///
/// [std]: std::fs::create_dir
/// This is an async version of [`std::fs::create_dir`].
///
/// # Platform-specific behavior
///
Expand Down
4 changes: 1 addition & 3 deletions tokio/src/fs/create_dir_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ use std::path::Path;
/// Recursively creates a directory and all of its parent components if they
/// are missing.
///
/// This is an async version of [`std::fs::create_dir_all`][std]
///
/// [std]: std::fs::create_dir_all
/// This is an async version of [`std::fs::create_dir_all`].
///
/// # Platform-specific behavior
///
Expand Down
14 changes: 3 additions & 11 deletions tokio/src/fs/dir_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ use std::path::Path;
///
/// This is a specialized version of [`std::fs::DirBuilder`] for usage on
/// the Tokio runtime.
///
/// [std::fs::DirBuilder]: std::fs::DirBuilder
#[derive(Debug, Default)]
pub struct DirBuilder {
/// Indicates whether to create parent directories if they are missing.
Expand All @@ -23,9 +21,7 @@ impl DirBuilder {
/// Creates a new set of options with default mode/security settings for all
/// platforms and also non-recursive.
///
/// This is an async version of [`std::fs::DirBuilder::new`][std]
///
/// [std]: std::fs::DirBuilder::new
/// This is an async version of [`std::fs::DirBuilder::new`].
///
/// # Examples
///
Expand All @@ -43,9 +39,7 @@ impl DirBuilder {
///
/// This option defaults to `false`.
///
/// This is an async version of [`std::fs::DirBuilder::recursive`][std]
///
/// [std]: std::fs::DirBuilder::recursive
/// This is an async version of [`std::fs::DirBuilder::recursive`].
///
/// # Examples
///
Expand All @@ -65,9 +59,7 @@ impl DirBuilder {
/// It is considered an error if the directory already exists unless
/// recursive mode is enabled.
///
/// This is an async version of [`std::fs::DirBuilder::create`][std]
///
/// [std]: std::fs::DirBuilder::create
/// This is an async version of [`std::fs::DirBuilder::create`].
///
/// # Errors
///
Expand Down
16 changes: 4 additions & 12 deletions tokio/src/fs/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use std::fs::File as StdFile;

/// A reference to an open file on the filesystem.
///
/// This is a specialized version of [`std::fs::File`][std] for usage from the
/// This is a specialized version of [`std::fs::File`] for usage from the
/// Tokio runtime.
///
/// An instance of a `File` can be read and/or written depending on what options
Expand All @@ -50,7 +50,6 @@ use std::fs::File as StdFile;
/// Reading and writing to a `File` is usually done using the convenience
/// methods found on the [`AsyncReadExt`] and [`AsyncWriteExt`] traits.
///
/// [std]: struct@std::fs::File
/// [`AsyncSeek`]: trait@crate::io::AsyncSeek
/// [`flush`]: fn@crate::io::AsyncWriteExt::flush
/// [`sync_all`]: fn@crate::fs::File::sync_all
Expand Down Expand Up @@ -224,10 +223,7 @@ impl File {
OpenOptions::new()
}

/// Converts a [`std::fs::File`][std] to a [`tokio::fs::File`][file].
///
/// [std]: std::fs::File
/// [file]: File
/// Converts a [`std::fs::File`] to a [`tokio::fs::File`](File).
///
/// # Examples
///
Expand Down Expand Up @@ -430,13 +426,11 @@ impl File {
Ok(File::from_std(std_file))
}

/// Destructures `File` into a [`std::fs::File`][std]. This function is
/// Destructures `File` into a [`std::fs::File`]. This function is
/// async to allow any in-flight operations to complete.
///
/// Use `File::try_into_std` to attempt conversion immediately.
///
/// [std]: std::fs::File
///
/// # Examples
///
/// ```no_run
Expand All @@ -453,9 +447,7 @@ impl File {
Arc::try_unwrap(self.std).expect("Arc::try_unwrap failed")
}

/// Tries to immediately destructure `File` into a [`std::fs::File`][std].
///
/// [std]: std::fs::File
/// Tries to immediately destructure `File` into a [`std::fs::File`].
///
/// # Errors
///
Expand Down
4 changes: 1 addition & 3 deletions tokio/src/fs/hard_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use std::path::Path;

/// Creates a new hard link on the filesystem.
///
/// This is an async version of [`std::fs::hard_link`][std]
///
/// [std]: std::fs::hard_link
/// This is an async version of [`std::fs::hard_link`].
///
/// The `dst` path will be a link pointing to the `src` path. Note that systems
/// often require these two paths to both be located on the same filesystem.
Expand Down
3 changes: 1 addition & 2 deletions tokio/src/fs/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::path::Path;
/// Given a path, queries the file system to get information about a file,
/// directory, etc.
///
/// This is an async version of [`std::fs::metadata`][std]
/// This is an async version of [`std::fs::metadata`].
///
/// This function will traverse symbolic links to query information about the
/// destination file.
Expand All @@ -18,7 +18,6 @@ use std::path::Path;
/// `GetFileAttributesEx` function on Windows. Note that, this [may change in
/// the future][changes].
///
/// [std]: std::fs::metadata
/// [changes]: https://doc.rust-lang.org/std/io/index.html#platform-specific-behavior
///
/// # Errors
Expand Down
4 changes: 1 addition & 3 deletions tokio/src/fs/open_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use std::os::windows::fs::OpenOptionsExt;
/// Generally speaking, when using `OpenOptions`, you'll first call [`new`],
/// then chain calls to methods to set each option, then call [`open`], passing
/// the path of the file you're trying to open. This will give you a
/// [`io::Result`][result] with a [`File`] inside that you can further operate
/// [`io::Result`] with a [`File`] inside that you can further operate
/// on.
///
/// This is a specialized version of [`std::fs::OpenOptions`] for usage from
Expand All @@ -36,11 +36,9 @@ use std::os::windows::fs::OpenOptionsExt;
///
/// [`new`]: OpenOptions::new
/// [`open`]: OpenOptions::open
/// [result]: std::io::Result
/// [`File`]: File
/// [`File::open`]: File::open
/// [`File::create`]: File::create
/// [`std::fs::OpenOptions`]: std::fs::OpenOptions
///
/// # Examples
///
Expand Down
4 changes: 1 addition & 3 deletions tokio/src/fs/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ use std::{io, path::Path};

/// Reads the entire contents of a file into a bytes vector.
///
/// This is an async version of [`std::fs::read`][std]
///
/// [std]: std::fs::read
/// This is an async version of [`std::fs::read`].
///
/// This is a convenience function for using [`File::open`] and [`read_to_end`]
/// with fewer imports and without an intermediate variable. It pre-allocates a
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/fs/read_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const CHUNK_SIZE: usize = 32;

/// Returns a stream over the entries within a directory.
///
/// This is an async version of [`std::fs::read_dir`](std::fs::read_dir)
/// This is an async version of [`std::fs::read_dir`].
///
/// This operation is implemented by running the equivalent blocking
/// operation on a separate thread pool using [`spawn_blocking`].
Expand Down
4 changes: 1 addition & 3 deletions tokio/src/fs/read_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use std::path::{Path, PathBuf};

/// Reads a symbolic link, returning the file that the link points to.
///
/// This is an async version of [`std::fs::read_link`][std]
///
/// [std]: std::fs::read_link
/// This is an async version of [`std::fs::read_link`].
pub async fn read_link(path: impl AsRef<Path>) -> io::Result<PathBuf> {
let path = path.as_ref().to_owned();
asyncify(move || std::fs::read_link(path)).await
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/fs/remove_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::path::Path;

/// Removes an existing, empty directory.
///
/// This is an async version of [`std::fs::remove_dir`](std::fs::remove_dir)
/// This is an async version of [`std::fs::remove_dir`].
pub async fn remove_dir(path: impl AsRef<Path>) -> io::Result<()> {
let path = path.as_ref().to_owned();
asyncify(move || std::fs::remove_dir(path)).await
Expand Down
4 changes: 1 addition & 3 deletions tokio/src/fs/remove_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ use std::path::Path;
/// depending on platform, other open file descriptors may prevent immediate
/// removal).
///
/// This is an async version of [`std::fs::remove_file`][std]
///
/// [std]: std::fs::remove_file
/// This is an async version of [`std::fs::remove_file`].
pub async fn remove_file(path: impl AsRef<Path>) -> io::Result<()> {
let path = path.as_ref().to_owned();
asyncify(move || std::fs::remove_file(path)).await
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/fs/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::path::Path;
///
/// This will not work if the new name is on a different mount point.
///
/// This is an async version of [`std::fs::rename`](std::fs::rename)
/// This is an async version of [`std::fs::rename`].
pub async fn rename(from: impl AsRef<Path>, to: impl AsRef<Path>) -> io::Result<()> {
let from = from.as_ref().to_owned();
let to = to.as_ref().to_owned();
Expand Down
4 changes: 1 addition & 3 deletions tokio/src/fs/symlink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ use std::path::Path;
///
/// The `dst` path will be a symbolic link pointing to the `src` path.
///
/// This is an async version of [`std::os::unix::fs::symlink`][std]
///
/// [std]: std::os::unix::fs::symlink
/// This is an async version of [`std::os::unix::fs::symlink`].
pub async fn symlink(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> io::Result<()> {
let src = src.as_ref().to_owned();
let dst = dst.as_ref().to_owned();
Expand Down
4 changes: 2 additions & 2 deletions tokio/src/sync/mpsc/bounded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::task::{Context, Poll};

/// Sends values to the associated `Receiver`.
///
/// Instances are created by the [`channel`](channel) function.
/// Instances are created by the [`channel`] function.
///
/// To convert the `Sender` into a `Sink` or use it in a poll function, you can
/// use the [`PollSender`] utility.
Expand Down Expand Up @@ -86,7 +86,7 @@ pub struct OwnedPermit<T> {

/// Receives values from the associated `Sender`.
///
/// Instances are created by the [`channel`](channel) function.
/// Instances are created by the [`channel`] function.
///
/// This receiver can be turned into a `Stream` using [`ReceiverStream`].
///
Expand Down
6 changes: 2 additions & 4 deletions tokio/src/sync/mpsc/unbounded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ use std::task::{Context, Poll};

/// Send values to the associated `UnboundedReceiver`.
///
/// Instances are created by the
/// [`unbounded_channel`](unbounded_channel) function.
/// Instances are created by the [`unbounded_channel`] function.
pub struct UnboundedSender<T> {
chan: chan::Tx<T, Semaphore>,
}
Expand Down Expand Up @@ -65,8 +64,7 @@ impl<T> fmt::Debug for UnboundedSender<T> {

/// Receive values from the associated `UnboundedSender`.
///
/// Instances are created by the
/// [`unbounded_channel`](unbounded_channel) function.
/// Instances are created by the [`unbounded_channel`] function.
///
/// This receiver can be turned into a `Stream` using [`UnboundedReceiverStream`].
///
Expand Down

0 comments on commit 558e767

Please sign in to comment.