Skip to content

Commit

Permalink
Merge pull request rust-lang#3114 from matthiaskrgr/typos
Browse files Browse the repository at this point in the history
fix a few typos found via codespell.
  • Loading branch information
topecongiro authored Oct 22, 2018
2 parents 7d713a2 + b25f974 commit a8d6874
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

### Changed

- Warn when unkown configuration option is used.
- Warn when unknown configuration option is used.

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion src/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion src/config/config_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(' ');
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/missed_spans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
2 changes: 1 addition & 1 deletion src/patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion tests/source/match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ fn issue339() {
{

}
p => { // Dont collapse me
p => { // Don't collapse me
} q => { } r =>
{

Expand Down
2 changes: 1 addition & 1 deletion tests/source/pattern-condense-wildcards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ fn main() {
Tup (_) => "nah",
Quad (_,_, x,_) => " also no rewrite",
Quad (x, _, _, _) => "condense me pls",
Weird (x, _, _, /* dont condense before */ _, _, _) => "pls work",
Weird (x, _, _, /* don't condense before */ _, _, _) => "pls work",
}
}
2 changes: 1 addition & 1 deletion tests/source/remove_blank_lines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn bar() {
// comment after statement


// comment before statment
// comment before statement
let y = 2;
let z = 3;

Expand Down
2 changes: 1 addition & 1 deletion tests/source/reorder-impl-items.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// rustfmt-reorder_impl_items: true

// The ordering of the folllowing impl items should be idempotent.
// The ordering of the following impl items should be idempotent.
impl<'a> Command<'a> {
pub fn send_to(&self, w: &mut io::Write) -> io::Result<()> {
match self {
Expand Down
2 changes: 1 addition & 1 deletion tests/target/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ impl<K, V, NodeRef: Deref<Target = Node<K, V>>> Handle<NodeRef, handle::Edge, ha

impl<V> Test<V>
where
V: Clone, // This comment is NOT removed by formating!
V: Clone, // This comment is NOT removed by formatting!
{
pub fn new(value: V) -> Self {
Test {
Expand Down
2 changes: 1 addition & 1 deletion tests/target/match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ fn issue339() {
n => {}
o => {}
p => {
// Dont collapse me
// Don't collapse me
}
q => {}
r => {}
Expand Down
2 changes: 1 addition & 1 deletion tests/target/pattern-condense-wildcards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ fn main() {
Tup(_) => "nah",
Quad(_, _, x, _) => " also no rewrite",
Quad(x, ..) => "condense me pls",
Weird(x, _, _, /* dont condense before */ ..) => "pls work",
Weird(x, _, _, /* don't condense before */ ..) => "pls work",
}
}
2 changes: 1 addition & 1 deletion tests/target/remove_blank_lines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn bar() {
let x = 1;
// comment after statement

// comment before statment
// comment before statement
let y = 2;
let z = 3;

Expand Down
2 changes: 1 addition & 1 deletion tests/target/reorder-impl-items.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// rustfmt-reorder_impl_items: true

// The ordering of the folllowing impl items should be idempotent.
// The ordering of the following impl items should be idempotent.
impl<'a> Command<'a> {
pub fn send_to(&self, w: &mut io::Write) -> io::Result<()> {
match self {
Expand Down

0 comments on commit a8d6874

Please sign in to comment.