diff --git a/src/uu/csplit/src/csplit.rs b/src/uu/csplit/src/csplit.rs index f109f0cdf..c01fc7786 100644 --- a/src/uu/csplit/src/csplit.rs +++ b/src/uu/csplit/src/csplit.rs @@ -1,4 +1,5 @@ #![crate_name = "uu_csplit"] +#![allow(rustdoc::private_intra_doc_links)] #[macro_use] extern crate uucore; @@ -83,12 +84,12 @@ impl CsplitOptions { /// # Errors /// /// - [`io::Error`] if there is some problem reading/writing from/to a file. -/// - [`::CsplitError::LineOutOfRange`] if the line number pattern is larger than the number of input +/// - [`CsplitError::LineOutOfRange`] if the line number pattern is larger than the number of input /// lines. -/// - [`::CsplitError::LineOutOfRangeOnRepetition`], like previous but after applying the pattern +/// - [`CsplitError::LineOutOfRangeOnRepetition`], like previous but after applying the pattern /// more than once. -/// - [`::CsplitError::MatchNotFound`] if no line matched a regular expression. -/// - [`::CsplitError::MatchNotFoundOnRepetition`], like previous but after applying the pattern +/// - [`CsplitError::MatchNotFound`] if no line matched a regular expression. +/// - [`CsplitError::MatchNotFoundOnRepetition`], like previous but after applying the pattern /// more than once. pub fn csplit( options: &CsplitOptions, @@ -243,7 +244,7 @@ impl<'a> SplitWriter<'a> { } /// Writes the line to the current split, appending a newline character. - /// If [`dev_null`] is true, then the line is discarded. + /// If [`self.dev_null`] is true, then the line is discarded. /// /// # Errors /// @@ -264,8 +265,8 @@ impl<'a> SplitWriter<'a> { } /// Perform some operations after completing a split, i.e., either remove it - /// if the [`::ELIDE_EMPTY_FILES_OPT`] option is enabled, or print how much bytes were written - /// to it if [`::QUIET_OPT`] is disabled. + /// if the [`options::ELIDE_EMPTY_FILES`] option is enabled, or print how much bytes were written + /// to it if [`options::QUIET`] is disabled. /// /// # Errors /// @@ -305,7 +306,7 @@ impl<'a> SplitWriter<'a> { /// /// In addition to errors reading/writing from/to a file, if the line number /// `n` is greater than the total available lines, then a - /// [`::CsplitError::LineOutOfRange`] error is returned. + /// [`CsplitError::LineOutOfRange`] error is returned. fn do_to_line( &mut self, pattern_as_str: &str, @@ -354,9 +355,9 @@ impl<'a> SplitWriter<'a> { /// # Errors /// /// In addition to errors reading/writing from/to a file, the following errors may be returned: - /// - if no line matched, an [`::CsplitError::MatchNotFound`]. + /// - if no line matched, an [`CsplitError::MatchNotFound`]. /// - if there are not enough lines to accommodate the offset, an - /// [`::CsplitError::LineOutOfRange`]. + /// [`CsplitError::LineOutOfRange`]. fn do_to_match( &mut self, pattern_as_str: &str, @@ -512,7 +513,7 @@ where self.size = size; } - /// Add a line to the buffer. If the buffer has [`size`] elements, then its head is removed and + /// Add a line to the buffer. If the buffer has [`self.size`] elements, then its head is removed and /// the new line is pushed to the buffer. The removed head is then available in the returned /// option. fn add_line_to_buffer(&mut self, ln: usize, line: String) -> Option { diff --git a/src/uu/csplit/src/patterns.rs b/src/uu/csplit/src/patterns.rs index 4ab7862ac..6689b79de 100644 --- a/src/uu/csplit/src/patterns.rs +++ b/src/uu/csplit/src/patterns.rs @@ -88,7 +88,7 @@ impl Iterator for ExecutePatternIter { /// /// # Errors /// -/// If a pattern is incorrect, a [`::CsplitError::InvalidPattern`] error is returned, which may be +/// If a pattern is incorrect, a [`CsplitError::InvalidPattern`] error is returned, which may be /// due to, e.g.,: /// - an invalid regular expression; /// - an invalid number for, e.g., the offset. diff --git a/src/uu/date/src/date.rs b/src/uu/date/src/date.rs index 8ffd62c0d..5f673147c 100644 --- a/src/uu/date/src/date.rs +++ b/src/uu/date/src/date.rs @@ -377,9 +377,9 @@ fn set_system_datetime(_date: DateTime) -> UResult<()> { #[cfg(all(unix, not(target_os = "macos"), not(target_os = "redox")))] /// System call to set date (unix). /// See here for more: -/// https://doc.rust-lang.org/libc/i686-unknown-linux-gnu/libc/fn.clock_settime.html -/// https://linux.die.net/man/3/clock_settime -/// https://www.gnu.org/software/libc/manual/html_node/Time-Types.html +/// `` +/// `` +/// `` fn set_system_datetime(date: DateTime) -> UResult<()> { let timespec = timespec { tv_sec: date.timestamp() as _, diff --git a/src/uu/dd/src/parseargs.rs b/src/uu/dd/src/parseargs.rs index fb3327822..57d93f966 100644 --- a/src/uu/dd/src/parseargs.rs +++ b/src/uu/dd/src/parseargs.rs @@ -86,7 +86,7 @@ impl UError for ParseError { } } -/// Some flags specified as part of a conv=CONV[,CONV]... block +/// Some flags specified as part of a conv=CONV\[,CONV\]... block /// relate to the input file, others to the output file. #[derive(Debug, PartialEq)] enum ConvFlag { diff --git a/src/uu/head/src/lines.rs b/src/uu/head/src/lines.rs index 118aba17f..474f5717d 100644 --- a/src/uu/head/src/lines.rs +++ b/src/uu/head/src/lines.rs @@ -9,7 +9,7 @@ const ZERO: u8 = 0; /// Returns an iterator over the lines of the given reader. /// /// The iterator returned from this function will yield instances of -/// [`io::Result`]<[`Vec`]<[`u8`]>>, representing the bytes of the line +/// [`std::io::Result`]<[`Vec`]<[`u8`]>>, representing the bytes of the line /// *including* the null character (with the possible exception of the /// last line, which may not have one). /// diff --git a/src/uu/head/src/parse.rs b/src/uu/head/src/parse.rs index f6f291814..8bcfea3da 100644 --- a/src/uu/head/src/parse.rs +++ b/src/uu/head/src/parse.rs @@ -12,7 +12,7 @@ pub enum ParseError { Overflow, } /// Parses obsolete syntax -/// head -NUM[kmzv] // spell-checker:disable-line +/// head -NUM\[kmzv\] // spell-checker:disable-line pub fn parse_obsolete(src: &str) -> Option, ParseError>> { let mut chars = src.char_indices(); if let Some((_, '-')) = chars.next() { diff --git a/src/uu/head/src/take.rs b/src/uu/head/src/take.rs index 5f4c29b65..fded202a5 100644 --- a/src/uu/head/src/take.rs +++ b/src/uu/head/src/take.rs @@ -65,7 +65,7 @@ where /// Like `std::io::Take`, but for lines instead of bytes. /// /// This struct is generally created by calling [`take_lines`] on a -/// reader. Please see the documentation of [`take`] for more +/// reader. Please see the documentation of [`take_lines`] for more /// details. pub struct TakeLines { inner: T, diff --git a/src/uu/install/src/install.rs b/src/uu/install/src/install.rs index 7f6727c38..7d34b3944 100644 --- a/src/uu/install/src/install.rs +++ b/src/uu/install/src/install.rs @@ -681,7 +681,7 @@ fn copy(from: &Path, to: &Path, b: &Behavior) -> UResult<()> { /// Return true if a file is necessary to copy. This is the case when: /// /// - _from_ or _to_ is nonexistent; -/// - either file has a sticky bit or set[ug]id bit, or the user specified one; +/// - either file has a sticky bit or set\[ug\]id bit, or the user specified one; /// - either file isn't a regular file; /// - the sizes of _from_ and _to_ differ; /// - _to_'s owner differs from intended; or diff --git a/src/uu/seq/src/number.rs b/src/uu/seq/src/number.rs index 9062fa1a1..cec96c0ba 100644 --- a/src/uu/seq/src/number.rs +++ b/src/uu/seq/src/number.rs @@ -4,7 +4,7 @@ //! The [`Number`] enumeration represents the possible values for the //! start, increment, and end values for `seq`. These may be integers, //! floating point numbers, negative zero, etc. A [`Number`] can be -//! parsed from a string by calling [`parse`]. +//! parsed from a string by calling [`str::parse`]. use num_traits::Zero; use crate::extendedbigdecimal::ExtendedBigDecimal; @@ -77,7 +77,7 @@ impl Number { /// /// This struct can be used to represent a number along with information /// on how many significant digits to use when displaying the number. -/// The [`num_integral_digits`] field also includes the width needed to +/// The [`PreciseNumber::num_integral_digits`] field also includes the width needed to /// display the "-" character for a negative number. /// /// You can get an instance of this struct by calling [`str::parse`]. diff --git a/src/uu/shuf/src/rand_read_adapter.rs b/src/uu/shuf/src/rand_read_adapter.rs index bde03a928..ea26890ca 100644 --- a/src/uu/shuf/src/rand_read_adapter.rs +++ b/src/uu/shuf/src/rand_read_adapter.rs @@ -29,7 +29,7 @@ use rand_core::{impls, Error, RngCore}; /// have enough data, will only be reported through [`try_fill_bytes`]. /// The other [`RngCore`] methods will panic in case of an error. /// -/// [`OsRng`]: crate::rngs::OsRng +/// [`OsRng`]: rand::rngs::OsRng /// [`try_fill_bytes`]: RngCore::try_fill_bytes #[derive(Debug)] pub struct ReadRng { diff --git a/src/uu/tail/src/chunks.rs b/src/uu/tail/src/chunks.rs index 57a26dabf..270493093 100644 --- a/src/uu/tail/src/chunks.rs +++ b/src/uu/tail/src/chunks.rs @@ -13,7 +13,7 @@ pub const BLOCK_SIZE: u64 = 1 << 16; /// /// Each chunk is a [`Vec`]<[`u8`]> of size [`BLOCK_SIZE`] (except /// possibly the last chunk, which might be smaller). Each call to -/// [`next`] will seek backwards through the given file. +/// [`ReverseChunks::next`] will seek backwards through the given file. pub struct ReverseChunks<'a> { /// The file to iterate over, by blocks, from the end to the beginning. file: &'a File, diff --git a/src/uu/tail/src/parse.rs b/src/uu/tail/src/parse.rs index 929681811..a788b2c48 100644 --- a/src/uu/tail/src/parse.rs +++ b/src/uu/tail/src/parse.rs @@ -11,7 +11,7 @@ pub enum ParseError { Overflow, } /// Parses obsolete syntax -/// tail -NUM[kmzv] // spell-checker:disable-line +/// tail -NUM\[kmzv\] // spell-checker:disable-line pub fn parse_obsolete(src: &str) -> Option, ParseError>> { let mut chars = src.char_indices(); if let Some((_, '-')) = chars.next() { diff --git a/src/uu/wc/src/countable.rs b/src/uu/wc/src/countable.rs index a14623559..5596decb3 100644 --- a/src/uu/wc/src/countable.rs +++ b/src/uu/wc/src/countable.rs @@ -1,7 +1,7 @@ //! Traits and implementations for iterating over lines in a file-like object. //! //! This module provides a [`WordCountable`] trait and implementations -//! for some common file-like objects. Use the [`WordCountable::lines`] +//! for some common file-like objects. Use the [`WordCountable::buffered`] //! method to get an iterator over lines of a file-like object. use std::fs::File; use std::io::{BufRead, BufReader, Read, StdinLock}; diff --git a/src/uucore/src/lib/features/pipes.rs b/src/uucore/src/lib/features/pipes.rs index b375982dd..87cbe9bf2 100644 --- a/src/uucore/src/lib/features/pipes.rs +++ b/src/uucore/src/lib/features/pipes.rs @@ -9,7 +9,7 @@ use nix::{fcntl::SpliceFFlags, sys::uio::IoVec}; pub use nix::{Error, Result}; -/// A wrapper around [`nix::unistd::Pipe`] that ensures the pipe is cleaned up. +/// A wrapper around [`nix::unistd::pipe`] that ensures the pipe is cleaned up. /// /// Returns two `File` objects: everything written to the second can be read /// from the first. diff --git a/src/uucore/src/lib/features/ringbuffer.rs b/src/uucore/src/lib/features/ringbuffer.rs index 9a6176f92..772336ef1 100644 --- a/src/uucore/src/lib/features/ringbuffer.rs +++ b/src/uucore/src/lib/features/ringbuffer.rs @@ -33,6 +33,9 @@ use std::collections::VecDeque; /// let expected = VecDeque::from_iter([1, 2].iter()); /// assert_eq!(expected, actual); /// ``` +/// +/// [`push_back`]: struct.RingBuffer.html#method.push_back +/// [`from_iter`]: struct.RingBuffer.html#method.from_iter pub struct RingBuffer { pub data: VecDeque, size: usize, diff --git a/src/uucore/src/lib/macros.rs b/src/uucore/src/lib/macros.rs index a3d5b299e..255ccd5b3 100644 --- a/src/uucore/src/lib/macros.rs +++ b/src/uucore/src/lib/macros.rs @@ -221,7 +221,7 @@ macro_rules! show_usage_error( }) ); -/// Display an error and [`exit!`] +/// Display an error and [`std::process::exit`] /// /// Displays the provided error message using [`show_error!`], then invokes /// [`std::process::exit`] with the provided exit code. diff --git a/src/uucore/src/lib/mods/backup_control.rs b/src/uucore/src/lib/mods/backup_control.rs index 2d1e4c4d5..e14716591 100644 --- a/src/uucore/src/lib/mods/backup_control.rs +++ b/src/uucore/src/lib/mods/backup_control.rs @@ -129,7 +129,7 @@ pub enum BackupMode { /// Backup error types. /// /// Errors are currently raised by [`determine_backup_mode`] only. All errors -/// are implemented as [`UCustomError`] for uniform handling across utilities. +/// are implemented as [`UError`] for uniform handling across utilities. #[derive(Debug, Eq, PartialEq)] pub enum BackupError { /// An invalid argument (e.g. 'foo') was given as backup type. First diff --git a/src/uucore/src/lib/mods/panic.rs b/src/uucore/src/lib/mods/panic.rs index ebba10429..dd0eff6a8 100644 --- a/src/uucore/src/lib/mods/panic.rs +++ b/src/uucore/src/lib/mods/panic.rs @@ -26,11 +26,11 @@ fn is_broken_pipe(info: &PanicInfo) -> bool { /// /// For background discussions on `SIGPIPE` handling, see /// -/// * https://github.com/uutils/coreutils/issues/374 -/// * https://github.com/uutils/coreutils/pull/1106 -/// * https://github.com/rust-lang/rust/issues/62569 -/// * https://github.com/BurntSushi/ripgrep/issues/200 -/// * https://github.com/crev-dev/cargo-crev/issues/287 +/// * `` +/// * `` +/// * `` +/// * `` +/// * `` /// pub fn mute_sigpipe_panic() { let hook = panic::take_hook();