Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/uu/csplit/src/csplit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ impl SplitWriter<'_> {
}

/// Writes the line to the current split.
/// If [`self.dev_null`] is true, then the line is discarded.
/// If `self.dev_null` is true, then the line is discarded.
///
/// # Errors
///
Expand Down Expand Up @@ -572,7 +572,7 @@ where
self.size = size;
}

/// Add a line to the buffer. If the buffer has [`self.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<String> {
Expand Down
6 changes: 3 additions & 3 deletions src/uu/split/src/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl Number {
///
/// If incrementing this number would result in an overflow beyond
/// the maximum representable number, then return
/// [`Err(Overflow)`]. The [`FixedWidthNumber`] overflows, but
/// `Err(Overflow)`. The [`FixedWidthNumber`] overflows, but
/// [`DynamicWidthNumber`] does not.
///
/// The [`DynamicWidthNumber`] follows a non-standard incrementing
Expand All @@ -122,7 +122,7 @@ impl Number {
///
/// # Errors
///
/// This method returns [`Err(Overflow)`] when attempting to
/// This method returns `Err(Overflow)` when attempting to
/// increment beyond the largest representable number.
///
/// # Examples
Expand Down Expand Up @@ -212,7 +212,7 @@ impl FixedWidthNumber {
///
/// This method adds one to this number. If incrementing this
/// number would require more digits than are available with the
/// specified width, then this method returns [`Err(Overflow)`].
/// specified width, then this method returns `Err(Overflow)`.
fn increment(&mut self) -> Result<(), Overflow> {
for i in (0..self.digits.len()).rev() {
// Increment the current digit.
Expand Down
6 changes: 3 additions & 3 deletions src/uu/tail/src/chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ impl BytesChunk {
}

/// Fills `self.buffer` with maximal [`BUFFER_SIZE`] number of bytes, draining the reader by
/// that number of bytes. If EOF is reached (so 0 bytes are read), then returns
/// [`UResult<None>`] or else the result with [`Some(bytes)`] where bytes is the number of bytes
/// read from the source.
/// that number of bytes. If EOF is reached (so 0 bytes are read), it returns
/// [`UResult<None>`]; otherwise, it returns [`UResult<Some(bytes)>`], where bytes is the
/// number of bytes read from the source.
pub fn fill(&mut self, filehandle: &mut impl BufRead) -> UResult<Option<usize>> {
let num_bytes = filehandle.read(&mut self.buffer)?;
self.bytes = num_bytes;
Expand Down
2 changes: 1 addition & 1 deletion src/uucore/src/lib/features/version_cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn version_non_digit_cmp(a: &[u8], b: &[u8]) -> Ordering {
}
}

/// Remove file endings matching the regex (\.[A-Za-z~][A-Za-z0-9~]*)*$
/// Remove file endings matching the regex `(\.[A-Za-z~][A-Za-z0-9~]*)*$`
fn remove_file_ending(a: &[u8]) -> &[u8] {
let mut ending_start = None;
let mut prev_was_dot = false;
Expand Down
4 changes: 2 additions & 2 deletions tests/uutests/src/lib/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ impl UCommand {

/// Set if process should be run in a simulated terminal
///
/// This is useful to test behavior that is only active if e.g. [`stdout.is_terminal()`] is [`true`].
/// This is useful to test behavior that is only active if e.g. `stdout.is_terminal()` is `true`.
/// This function uses default terminal size and attaches stdin, stdout and stderr to that terminal.
/// For more control over the terminal simulation, use `terminal_sim_stdio`
/// (unix: pty, windows: `ConPTY`[not yet supported])
Expand All @@ -1693,7 +1693,7 @@ impl UCommand {

/// Allows to simulate a terminal use-case with specific properties.
///
/// This is useful to test behavior that is only active if e.g. [`stdout.is_terminal()`] is [`true`].
/// This is useful to test behavior that is only active if e.g. `stdout.is_terminal()` is `true`.
/// This function allows to set a specific size and to attach the terminal to only parts of the in/out.
#[cfg(unix)]
pub fn terminal_sim_stdio(&mut self, config: TerminalSimulation) -> &mut Self {
Expand Down
Loading