diff --git a/src/uu/od/src/inputdecoder.rs b/src/uu/od/src/inputdecoder.rs index 31e833698..318571cf3 100644 --- a/src/uu/od/src/inputdecoder.rs +++ b/src/uu/od/src/inputdecoder.rs @@ -56,7 +56,7 @@ where I: PeekRead, { /// calls `peek_read` on the internal stream to (re)fill the buffer. Returns a - /// MemoryDecoder providing access to the result or returns an i/o error. + /// `MemoryDecoder` providing access to the result or returns an i/o error. pub fn peek_read(&mut self) -> io::Result { match self .input @@ -81,7 +81,7 @@ impl<'a, I> HasError for InputDecoder<'a, I> where I: HasError, { - /// calls has_error on the internal stream. + /// calls `has_error` on the internal stream. fn has_error(&self) -> bool { self.input.has_error() } diff --git a/src/uu/od/src/od.rs b/src/uu/od/src/od.rs index e41776ac4..5e8f8814d 100644 --- a/src/uu/od/src/od.rs +++ b/src/uu/od/src/od.rs @@ -28,17 +28,17 @@ mod prn_int; use std::cmp; use std::fmt::Write; -use crate::byteorder_io::*; -use crate::formatteriteminfo::*; +use crate::byteorder_io::ByteOrder; +use crate::formatteriteminfo::FormatWriter; use crate::inputdecoder::{InputDecoder, MemoryDecoder}; use crate::inputoffset::{InputOffset, Radix}; -use crate::multifilereader::*; +use crate::multifilereader::{HasError, InputSource, MultifileReader}; use crate::output_info::OutputInfo; use crate::parse_formats::{parse_format_flags, ParsedFormatterItemInfo}; use crate::parse_inputs::{parse_inputs, CommandLineInputs}; use crate::parse_nrofbytes::parse_number_of_bytes; -use crate::partialreader::*; -use crate::peekreader::*; +use crate::partialreader::PartialReader; +use crate::peekreader::{PeekRead, PeekReader}; use crate::prn_char::format_ascii_dump; use clap::ArgAction; use clap::{crate_version, parser::ValueSource, Arg, ArgMatches, Command}; @@ -48,10 +48,9 @@ use uucore::parse_size::ParseSizeError; use uucore::{format_usage, help_about, help_section, help_usage, show_error, show_warning}; const PEEK_BUFFER_SIZE: usize = 4; // utf-8 can be 4 bytes + const ABOUT: &str = help_about!("od.md"); - const USAGE: &str = help_usage!("od.md"); - const AFTER_HELP: &str = help_section!("after help", "od.md"); pub(crate) mod options { @@ -460,7 +459,7 @@ pub fn uu_app() -> Command { ) } -/// Loops through the input line by line, calling print_bytes to take care of the output. +/// Loops through the input line by line, calling `print_bytes` to take care of the output. fn odfunc( input_offset: &mut InputOffset, input_decoder: &mut InputDecoder, diff --git a/src/uu/od/src/output_info.rs b/src/uu/od/src/output_info.rs index 60cbaf5ab..211574a61 100644 --- a/src/uu/od/src/output_info.rs +++ b/src/uu/od/src/output_info.rs @@ -139,7 +139,7 @@ impl OutputInfo { /// ``` /// /// This algorithm assumes the size of all types is a power of 2 (1, 2, 4, 8, 16, ...) - /// Increase MAX_BYTES_PER_UNIT to allow larger types. + /// Increase `MAX_BYTES_PER_UNIT` to allow larger types. fn calculate_alignment( sf: &dyn TypeSizeInfo, byte_size_block: usize, diff --git a/src/uu/od/src/parse_inputs.rs b/src/uu/od/src/parse_inputs.rs index 275ab8cfc..3093843d4 100644 --- a/src/uu/od/src/parse_inputs.rs +++ b/src/uu/od/src/parse_inputs.rs @@ -90,8 +90,8 @@ pub fn parse_inputs(matches: &dyn CommandLineOpts) -> Result Result { match input_strings.len() { 0 => Ok(CommandLineInputs::FileNames(vec!["-".to_string()])), diff --git a/src/uu/od/src/prn_char.rs b/src/uu/od/src/prn_char.rs index 495b8eace..7ae6f084c 100644 --- a/src/uu/od/src/prn_char.rs +++ b/src/uu/od/src/prn_char.rs @@ -1,6 +1,6 @@ use std::str::from_utf8; -use crate::formatteriteminfo::*; +use crate::formatteriteminfo::{FormatWriter, FormatterItemInfo}; pub static FORMAT_ITEM_A: FormatterItemInfo = FormatterItemInfo { byte_size: 1, diff --git a/src/uu/od/src/prn_float.rs b/src/uu/od/src/prn_float.rs index be1463163..496275574 100644 --- a/src/uu/od/src/prn_float.rs +++ b/src/uu/od/src/prn_float.rs @@ -3,7 +3,7 @@ use std::f32; use std::f64; use std::num::FpCategory; -use crate::formatteriteminfo::*; +use crate::formatteriteminfo::{FormatWriter, FormatterItemInfo}; pub static FORMAT_ITEM_F16: FormatterItemInfo = FormatterItemInfo { byte_size: 2,