From 78d2e8db27bab9e39abf70003ad487acf53c2290 Mon Sep 17 00:00:00 2001 From: Joseph Crail Date: Fri, 25 Nov 2016 14:36:56 -0500 Subject: [PATCH] Fix comment spelling --- src/dircolors/dircolors.rs | 2 +- src/env/env.rs | 2 +- src/factor/factor.rs | 2 +- src/fmt/parasplit.rs | 2 +- src/install/install.rs | 2 +- src/mkdir/mkdir.rs | 2 +- src/mktemp/mktemp.rs | 2 +- src/nl/nl.rs | 2 +- src/od/inputdecoder.rs | 2 +- src/od/od.rs | 2 +- src/od/output_info.rs | 4 ++-- src/od/parse_formats.rs | 2 +- src/od/prn_float.rs | 2 +- src/pathchk/pathchk.rs | 4 ++-- .../tokenize/num_format/formatters/cninetyninehexfloatf.rs | 4 ++-- src/printf/tokenize/num_format/num_format.rs | 2 +- src/printf/tokenize/token.rs | 2 +- src/printf/tokenize/unescaped_text.rs | 2 +- src/uucore/utmpx.rs | 2 +- tests/test_od.rs | 6 +++--- 20 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/dircolors/dircolors.rs b/src/dircolors/dircolors.rs index c5a0ae29f..23d9717b7 100644 --- a/src/dircolors/dircolors.rs +++ b/src/dircolors/dircolors.rs @@ -137,7 +137,7 @@ pub fn uumain(args: Vec) -> i32 { } pub trait StrUtils { - /// Remove comments and trim whitespaces + /// Remove comments and trim whitespace fn purify(&self) -> &Self; /// Like split_whitespace() but only produce 2 components fn split_two(&self) -> (&str, &str); diff --git a/src/env/env.rs b/src/env/env.rs index eb57d69f1..90618a415 100644 --- a/src/env/env.rs +++ b/src/env/env.rs @@ -63,7 +63,7 @@ pub fn uumain(args: Vec) -> i32 { let mut item = iter.next(); // the for loop doesn't work here, - // because we need sometines to read 2 items forward, + // because we need sometimes to read 2 items forward, // and the iter can't be borrowed twice while item != None { let opt = item.unwrap(); diff --git a/src/factor/factor.rs b/src/factor/factor.rs index 134acf6ca..9b1524f71 100644 --- a/src/factor/factor.rs +++ b/src/factor/factor.rs @@ -64,7 +64,7 @@ fn rho_pollard_find_divisor(num: u64) -> u64 { y = rho_pollard_pseudorandom_function(y, a, b, num); let d = gcd(num, max(x, y) - min(x, y)); if d == num { - // Failure, retry with diffrent function + // Failure, retry with different function x = range.ind_sample(&mut rng); y = x; a = range.ind_sample(&mut rng); diff --git a/src/fmt/parasplit.rs b/src/fmt/parasplit.rs index 857a9b0f2..68ec74d0c 100644 --- a/src/fmt/parasplit.rs +++ b/src/fmt/parasplit.rs @@ -332,7 +332,7 @@ impl<'a> Iterator for ParagraphStream<'a> { // in tagged mode, add 4 spaces of additional indenting by default // (gnu fmt's behavior is different: it seems to find the closest column to - // indent_end that is divisible by 3. But honesly that behavior seems + // indent_end that is divisible by 3. But honestly that behavior seems // pretty arbitrary. // Perhaps a better default would be 1 TABWIDTH? But ugh that's so big. if self.opts.tagged { diff --git a/src/install/install.rs b/src/install/install.rs index 2f00d6281..53fe7b23a 100644 --- a/src/install/install.rs +++ b/src/install/install.rs @@ -94,7 +94,7 @@ pub fn uumain(args: Vec) -> i32 { } } -/// Build a specification of the comamnd line. +/// Build a specification of the command line. /// /// Returns a getopts::Options struct. /// diff --git a/src/mkdir/mkdir.rs b/src/mkdir/mkdir.rs index 57c29f34d..4b52b531b 100644 --- a/src/mkdir/mkdir.rs +++ b/src/mkdir/mkdir.rs @@ -29,7 +29,7 @@ pub fn uumain(args: Vec) -> i32 { let mut opts = getopts::Options::new(); // Linux-specific options, not implemented - // opts.optflag("Z", "context", "set SELinux secutiry context" + + // opts.optflag("Z", "context", "set SELinux security context" + // " of each created directory to CTX"), opts.optopt("m", "mode", "set file mode", "755"); opts.optflag("p", "parents", "make parent directories as needed"); diff --git a/src/mktemp/mktemp.rs b/src/mktemp/mktemp.rs index 990edeb74..c790124bd 100644 --- a/src/mktemp/mktemp.rs +++ b/src/mktemp/mktemp.rs @@ -214,7 +214,7 @@ fn exec(tmpdir: PathBuf, prefix: &str, rand: usize, suffix: &str, make_dir: bool println!("{}", tmpname); // CAUTION: Not to call `drop` of tmpfile, which removes the tempfile, - // I call a dengeros function `forget`. + // I call a dangerous function `forget`. forget(tmpfile); 0 diff --git a/src/nl/nl.rs b/src/nl/nl.rs index 8d54b6115..fc7105f66 100644 --- a/src/nl/nl.rs +++ b/src/nl/nl.rs @@ -52,7 +52,7 @@ pub struct Settings { number_separator: String } -// NumberingStyle stores which lines are to be numberd. +// NumberingStyle stores which lines are to be numbered. // The possible options are: // 1. Number all lines // 2. Number only nonempty lines diff --git a/src/od/inputdecoder.rs b/src/od/inputdecoder.rs index e58cf79f3..feec673bb 100644 --- a/src/od/inputdecoder.rs +++ b/src/od/inputdecoder.rs @@ -13,7 +13,7 @@ pub struct InputDecoder<'a, I> where I: 'a { /// A memory buffer, it's size is set in `new`. data: Vec, - /// The numer of bytes in the buffer reserved for the peek data from `PeekRead`. + /// The number of bytes in the buffer reserved for the peek data from `PeekRead`. reserved_peek_length: usize, /// The number of (valid) bytes in the buffer. diff --git a/src/od/od.rs b/src/od/od.rs index 4228fe032..488897a40 100644 --- a/src/od/od.rs +++ b/src/od/od.rs @@ -427,7 +427,7 @@ fn print_bytes(prefix: &str, input_decoder: &MemoryDecoder, output_info: &Output /// returns a reader implementing `PeekRead + Read + HasError` providing the combined input /// /// `skip_bytes` is the number of bytes skipped from the input -/// `read_bytes` is an optinal limit to the number of bytes to read +/// `read_bytes` is an optional limit to the number of bytes to read fn open_input_peek_reader<'a>(input_strings: &'a Vec, skip_bytes: usize, read_bytes: Option) -> PeekReader>> { // should return "impl PeekRead + Read + HasError" when supported in (stable) rust diff --git a/src/od/output_info.rs b/src/od/output_info.rs index 5f8d8733e..b8c464284 100644 --- a/src/od/output_info.rs +++ b/src/od/output_info.rs @@ -92,7 +92,7 @@ impl OutputInfo { /// ``` /// In this example is additional spacing before the first and third decimal number, /// and there is additional spacing before the 1st, 3rd, 5th and 7th hexadecimal number. - /// This way both the octal and decimal, aswell the decimal and hexadecimal numbers + /// This way both the octal and decimal, as well as the decimal and hexadecimal numbers /// left align. Note that the alignment below both octal numbers is identical. /// /// This function calculates the required spacing for a single line, given the size @@ -110,7 +110,7 @@ impl OutputInfo { /// If the blocksize is 8, and the size of the type is 2, the spacing will be /// spread across position 0, 2, 4, 6. All 4 positions will get an additional /// space as long as there are more then 4 spaces available. If there are 2 - /// spaces available, they will be assigend to position 0 and 4. If there is + /// spaces available, they will be assigned to position 0 and 4. If there is /// 1 space available, it will be assigned to position 0. This will be combined, /// For example 7 spaces will be assigned to position 0, 2, 4, 6 like: 3, 1, 2, 1. /// And 7 spaces with 2 positions will be assigned to position 0 and 4 like 4, 3. diff --git a/src/od/parse_formats.rs b/src/od/parse_formats.rs index 472208e5a..6669b09bb 100644 --- a/src/od/parse_formats.rs +++ b/src/od/parse_formats.rs @@ -317,7 +317,7 @@ pub fn parse_format_flags_str(args_str: &Vec<&'static str>) -> Result Err(e), Ok(v) => { - // tests using this function asume add_ascii_dump is not set + // tests using this function assume add_ascii_dump is not set Ok(v.into_iter() .inspect(|f| assert!(!f.add_ascii_dump)) .map(|f| f.formatter_item_info) diff --git a/src/od/prn_float.rs b/src/od/prn_float.rs index 26037c8b4..5162fbc29 100644 --- a/src/od/prn_float.rs +++ b/src/od/prn_float.rs @@ -39,7 +39,7 @@ fn format_flo16(f: f16) -> String { } // formats float with 8 significant digits, eg 12345678 or -1.2345678e+12 -// always retuns a string of 14 characters +// always returns a string of 14 characters fn format_flo32(f: f32) -> String { let width: usize = 14; let precision: usize = 8; diff --git a/src/pathchk/pathchk.rs b/src/pathchk/pathchk.rs index 7f320cfe5..085c92c92 100644 --- a/src/pathchk/pathchk.rs +++ b/src/pathchk/pathchk.rs @@ -33,7 +33,7 @@ enum Mode { static NAME: &'static str = "pathchk"; static VERSION: &'static str = env!("CARGO_PKG_VERSION"); -// a few global constants as used in the GNU implememntation +// a few global constants as used in the GNU implementation static POSIX_PATH_MAX: usize = 256; static POSIX_NAME_MAX: usize = 14; @@ -207,7 +207,7 @@ fn check_searchable(path: &String) -> bool { } } -// check for a hypthen at the beginning of a path segment +// check for a hyphen at the beginning of a path segment fn no_leading_hyphen(path_segment: &String) -> bool { !path_segment.starts_with('-') } diff --git a/src/printf/tokenize/num_format/formatters/cninetyninehexfloatf.rs b/src/printf/tokenize/num_format/formatters/cninetyninehexfloatf.rs index 3c65d436e..8dcd93187 100644 --- a/src/printf/tokenize/num_format/formatters/cninetyninehexfloatf.rs +++ b/src/printf/tokenize/num_format/formatters/cninetyninehexfloatf.rs @@ -41,7 +41,7 @@ impl Formatter for CninetyNineHexFloatf { // c99 hex has unique requirements of all floating point subs in pretty much every part of building a primitive, from prefix and suffix to need for base conversion (in all other cases if you don't have decimal you must have decimal, here it's the other way around) -// on the todo list is to have a trait for get_primitive that is implemented by each float formatter and can override a default. when that happens we can take the parts of get_primitive_dec specific to dec and spin them out to their own functions that can be overriden. +// on the todo list is to have a trait for get_primitive that is implemented by each float formatter and can override a default. when that happens we can take the parts of get_primitive_dec specific to dec and spin them out to their own functions that can be overridden. #[allow(unused_variables)] #[allow(unused_assignments)] fn get_primitive_hex(inprefix: &InPrefix, @@ -93,7 +93,7 @@ fn get_primitive_hex(inprefix: &InPrefix, // the addition or subtraction of 4 (2**4, because 4 bits in a hex digit) // to the exponent. // decimal's going to be a little more complicated. correct simulation - // of glibc will require after-decimal division to a specified precisino. + // of glibc will require after-decimal division to a specified precision. // the difficult part of this (arrnum_int_div_step) is already implemented. // the hex float name may be a bit misleading in terms of how to go about the diff --git a/src/printf/tokenize/num_format/num_format.rs b/src/printf/tokenize/num_format/num_format.rs index 77a4ef62a..dd2185cb0 100644 --- a/src/printf/tokenize/num_format/num_format.rs +++ b/src/printf/tokenize/num_format/num_format.rs @@ -16,7 +16,7 @@ pub fn warn_expected_numeric(pf_arg: &String) { cli::err_msg(&format!("{}: expected a numeric value", pf_arg)); } -// when character costant arguments have excess characters +// when character constant arguments have excess characters // issue a warning when POSIXLY_CORRECT is not set fn warn_char_constant_ign(remaining_bytes: Vec) { match env::var("POSIXLY_CORRECT") { diff --git a/src/printf/tokenize/token.rs b/src/printf/tokenize/token.rs index 996151cd1..378702682 100644 --- a/src/printf/tokenize/token.rs +++ b/src/printf/tokenize/token.rs @@ -17,7 +17,7 @@ pub trait Token { // at a position in a format string, and sees whether // it can return a token of a type it knows how to produce // if so, return the token, move the iterator past the -// format string text the token repsresents, and if an +// format string text the token represents, and if an // argument is used move the argument iter forward one // creating token of a format string segment should also cause diff --git a/src/printf/tokenize/unescaped_text.rs b/src/printf/tokenize/unescaped_text.rs index 4053d6bba..45f006fdf 100644 --- a/src/printf/tokenize/unescaped_text.rs +++ b/src/printf/tokenize/unescaped_text.rs @@ -170,7 +170,7 @@ impl UnescapedText { } - // take an iteratator to a string, + // take an iterator to a string, // and return a wrapper around a Vec of unescaped bytes // break on encounter of sub symbol ('%[^%]') unless called // through %b subst. diff --git a/src/uucore/utmpx.rs b/src/uucore/utmpx.rs index 8ce06df3e..ddf976ab9 100644 --- a/src/uucore/utmpx.rs +++ b/src/uucore/utmpx.rs @@ -55,7 +55,7 @@ pub unsafe extern "C" fn utmpxname(_file: *const libc::c_char) -> libc::c_int { 0 } -// In case the c_char array doesn' t end with NULL +// In case the c_char array doesn't end with NULL macro_rules! chars2string { ($arr:expr) => ( $arr.iter().take_while(|i| **i > 0).map(|&i| i as u8 as char).collect::() diff --git a/tests/test_od.rs b/tests/test_od.rs index e732de55d..b0de215e2 100644 --- a/tests/test_od.rs +++ b/tests/test_od.rs @@ -16,8 +16,8 @@ static ALPHA_OUT: &'static str = " 0000033 "; -// XXX We could do a better job of ensuring that we have a fresh temp dir to ourself, -// not a general one ful of other proc's leftovers. +// XXX We could do a better job of ensuring that we have a fresh temp dir to ourselves, +// not a general one full of other proc's leftovers. // Test that od can read one file and dump with default format #[test] @@ -72,7 +72,7 @@ fn test_2files() { let _ = remove_file(file2); } -// Test that od gives non-0 exit val for filename that dosen't exist. +// Test that od gives non-0 exit val for filename that doesn't exist. #[test] fn test_no_file() { let temp = env::temp_dir();