diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2018-10-19 00:44:14 +0200 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2018-10-19 12:28:00 +0200 |
| commit | b25f974c0d6277de3f8f8473533f3f263ec9fbb7 (patch) | |
| tree | b57bb72c1fa54d881fe171f985fa795462c16eba /src | |
| parent | 7d713a2827d073e0141731d3fea1b06a5fbb2d58 (diff) | |
fix a few typos found via codespell.
Diffstat (limited to 'src')
| -rw-r--r-- | src/comment.rs | 2 | ||||
| -rw-r--r-- | src/config/config_type.rs | 2 | ||||
| -rw-r--r-- | src/items.rs | 2 | ||||
| -rw-r--r-- | src/lib.rs | 4 | ||||
| -rw-r--r-- | src/missed_spans.rs | 2 | ||||
| -rw-r--r-- | src/patterns.rs | 2 | ||||
| -rw-r--r-- | src/string.rs | 4 |
7 files changed, 9 insertions, 9 deletions
diff --git a/src/comment.rs b/src/comment.rs index 9dd7d689655..358c18e1b95 100644 --- a/src/comment.rs +++ b/src/comment.rs @@ -832,7 +832,7 @@ fn trim_custom_comment_prefix(s: &str) -> String { let left_trimmed = line.trim_left(); if left_trimmed.starts_with(RUSTFMT_CUSTOM_COMMENT_PREFIX) { let orig = left_trimmed.trim_left_matches(RUSTFMT_CUSTOM_COMMENT_PREFIX); - // due to comment wrapping, a line that was originaly behind `#` is split over + // due to comment wrapping, a line that was originally behind `#` is split over // multiple lines, which needs then to be prefixed with a `#` if !orig.trim_left().starts_with("# ") { Cow::from(format!("# {}", orig)) diff --git a/src/config/config_type.rs b/src/config/config_type.rs index 419cd06436f..b7c1da36017 100644 --- a/src/config/config_type.rs +++ b/src/config/config_type.rs @@ -424,7 +424,7 @@ macro_rules! create_config { self.ignore.2.add_prefix(dir); } - /// Returns true if the config key was explicitely set and is the default value. + /// Returns true if the config key was explicitly set and is the default value. pub fn is_default(&self, key: &str) -> bool { $( if let stringify!($i) = key { diff --git a/src/items.rs b/src/items.rs index 19caafbfb82..ee4cd866ac2 100644 --- a/src/items.rs +++ b/src/items.rs @@ -1592,7 +1592,7 @@ pub fn rewrite_struct_field( for _ in 0..lhs_offset { spacing.push(' '); } - // In this extreme case we will be missing a space betweeen an attribute and a field. + // In this extreme case we will be missing a space between an attribute and a field. if prefix.is_empty() && !attrs_str.is_empty() && attrs_extendable && spacing.is_empty() { spacing.push(' '); } diff --git a/src/lib.rs b/src/lib.rs index ff006325be0..6f366f0b64a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -117,7 +117,7 @@ pub enum ErrorKind { /// An io error during reading or writing. #[fail(display = "io error: {}", _0)] IoError(io::Error), - /// Parse error occured when parsing the Input. + /// Parse error occurred when parsing the input. #[fail(display = "parse error")] ParseError, /// The user mandated a version and the current version of Rustfmt does not @@ -407,7 +407,7 @@ fn format_code_block(code_snippet: &str, config: &Config) -> Option<String> { // While formatting the code, ignore the config's newline style setting and always use "\n" // instead of "\r\n" for the newline characters. This is okay because the output here is // not directly outputted by rustfmt command, but used by the comment formatter's input. - // We have output-file-wide "\n" ==> "\r\n" conversion proccess after here if it's necessary. + // We have output-file-wide "\n" ==> "\r\n" conversion process after here if it's necessary. let mut config_with_unix_newline = config.clone(); config_with_unix_newline .set() diff --git a/src/missed_spans.rs b/src/missed_spans.rs index b7d73bbf0ba..2b48673dcd4 100644 --- a/src/missed_spans.rs +++ b/src/missed_spans.rs @@ -20,7 +20,7 @@ use utils::{count_newlines, last_line_width, mk_sp}; use visitor::FmtVisitor; struct SnippetStatus { - /// An offset to the current line from the beginnig of the original snippet. + /// An offset to the current line from the beginning of the original snippet. line_start: usize, /// A length of trailing whitespaces on the current line. last_wspace: Option<usize>, diff --git a/src/patterns.rs b/src/patterns.rs index bd4af3f7bba..675572f4908 100644 --- a/src/patterns.rs +++ b/src/patterns.rs @@ -29,7 +29,7 @@ use spanned::Spanned; use types::{rewrite_path, PathContext}; use utils::{format_mutability, mk_sp, rewrite_ident}; -/// Returns true if the given pattern is short. A short pattern is defined by the following grammer: +/// Returns true if the given pattern is short. A short pattern is defined by the following grammar: /// /// [small, ntp]: /// - single token diff --git a/src/string.rs b/src/string.rs index bbf51ffcba3..561d96813b0 100644 --- a/src/string.rs +++ b/src/string.rs @@ -62,7 +62,7 @@ impl<'a> StringFormat<'a> { ) } - /// Like max_chars_with_indent but the indentation is not substracted. + /// Like max_chars_with_indent but the indentation is not subtracted. /// This allows to fit more graphemes from the string on a line when /// SnippetState::EndWithLineFeed. fn max_chars_without_indent(&self) -> Option<usize> { @@ -236,7 +236,7 @@ fn break_string(max_chars: usize, trim_end: bool, line_end: &str, input: &[&str] .iter() .rposition(|grapheme| not_whitespace_except_line_feed(grapheme)) .unwrap_or(index); - // Take into account newlines occuring in input[0..=index], i.e., the possible next new + // Take into account newlines occurring in input[0..=index], i.e., the possible next new // line. If there is one, then text after it could be rewritten in a way that the available // space is fully used. for (i, grapheme) in input[0..=index].iter().enumerate() { |
