Skip to content

Commit a8d6874

Browse files
authored
Merge pull request rust-lang#3114 from matthiaskrgr/typos
fix a few typos found via codespell.
2 parents 7d713a2 + b25f974 commit a8d6874

17 files changed

+19
-19
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797

9898
### Changed
9999

100-
- Warn when unkown configuration option is used.
100+
- Warn when unknown configuration option is used.
101101

102102
### Fixed
103103

src/comment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ fn trim_custom_comment_prefix(s: &str) -> String {
832832
let left_trimmed = line.trim_left();
833833
if left_trimmed.starts_with(RUSTFMT_CUSTOM_COMMENT_PREFIX) {
834834
let orig = left_trimmed.trim_left_matches(RUSTFMT_CUSTOM_COMMENT_PREFIX);
835-
// due to comment wrapping, a line that was originaly behind `#` is split over
835+
// due to comment wrapping, a line that was originally behind `#` is split over
836836
// multiple lines, which needs then to be prefixed with a `#`
837837
if !orig.trim_left().starts_with("# ") {
838838
Cow::from(format!("# {}", orig))

src/config/config_type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ macro_rules! create_config {
424424
self.ignore.2.add_prefix(dir);
425425
}
426426

427-
/// Returns true if the config key was explicitely set and is the default value.
427+
/// Returns true if the config key was explicitly set and is the default value.
428428
pub fn is_default(&self, key: &str) -> bool {
429429
$(
430430
if let stringify!($i) = key {

src/items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,7 @@ pub fn rewrite_struct_field(
15921592
for _ in 0..lhs_offset {
15931593
spacing.push(' ');
15941594
}
1595-
// In this extreme case we will be missing a space betweeen an attribute and a field.
1595+
// In this extreme case we will be missing a space between an attribute and a field.
15961596
if prefix.is_empty() && !attrs_str.is_empty() && attrs_extendable && spacing.is_empty() {
15971597
spacing.push(' ');
15981598
}

src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub enum ErrorKind {
117117
/// An io error during reading or writing.
118118
#[fail(display = "io error: {}", _0)]
119119
IoError(io::Error),
120-
/// Parse error occured when parsing the Input.
120+
/// Parse error occurred when parsing the input.
121121
#[fail(display = "parse error")]
122122
ParseError,
123123
/// 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> {
407407
// While formatting the code, ignore the config's newline style setting and always use "\n"
408408
// instead of "\r\n" for the newline characters. This is okay because the output here is
409409
// not directly outputted by rustfmt command, but used by the comment formatter's input.
410-
// We have output-file-wide "\n" ==> "\r\n" conversion proccess after here if it's necessary.
410+
// We have output-file-wide "\n" ==> "\r\n" conversion process after here if it's necessary.
411411
let mut config_with_unix_newline = config.clone();
412412
config_with_unix_newline
413413
.set()

src/missed_spans.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use utils::{count_newlines, last_line_width, mk_sp};
2020
use visitor::FmtVisitor;
2121

2222
struct SnippetStatus {
23-
/// An offset to the current line from the beginnig of the original snippet.
23+
/// An offset to the current line from the beginning of the original snippet.
2424
line_start: usize,
2525
/// A length of trailing whitespaces on the current line.
2626
last_wspace: Option<usize>,

src/patterns.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use spanned::Spanned;
2929
use types::{rewrite_path, PathContext};
3030
use utils::{format_mutability, mk_sp, rewrite_ident};
3131

32-
/// Returns true if the given pattern is short. A short pattern is defined by the following grammer:
32+
/// Returns true if the given pattern is short. A short pattern is defined by the following grammar:
3333
///
3434
/// [small, ntp]:
3535
/// - single token

src/string.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<'a> StringFormat<'a> {
6262
)
6363
}
6464

65-
/// Like max_chars_with_indent but the indentation is not substracted.
65+
/// Like max_chars_with_indent but the indentation is not subtracted.
6666
/// This allows to fit more graphemes from the string on a line when
6767
/// SnippetState::EndWithLineFeed.
6868
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]
236236
.iter()
237237
.rposition(|grapheme| not_whitespace_except_line_feed(grapheme))
238238
.unwrap_or(index);
239-
// Take into account newlines occuring in input[0..=index], i.e., the possible next new
239+
// Take into account newlines occurring in input[0..=index], i.e., the possible next new
240240
// line. If there is one, then text after it could be rewritten in a way that the available
241241
// space is fully used.
242242
for (i, grapheme) in input[0..=index].iter().enumerate() {

tests/source/match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ fn issue339() {
150150
{
151151

152152
}
153-
p => { // Dont collapse me
153+
p => { // Don't collapse me
154154
} q => { } r =>
155155
{
156156

tests/source/pattern-condense-wildcards.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ fn main() {
77
Tup (_) => "nah",
88
Quad (_,_, x,_) => " also no rewrite",
99
Quad (x, _, _, _) => "condense me pls",
10-
Weird (x, _, _, /* dont condense before */ _, _, _) => "pls work",
10+
Weird (x, _, _, /* don't condense before */ _, _, _) => "pls work",
1111
}
1212
}

tests/source/remove_blank_lines.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn bar() {
3535
// comment after statement
3636

3737

38-
// comment before statment
38+
// comment before statement
3939
let y = 2;
4040
let z = 3;
4141

tests/source/reorder-impl-items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// rustfmt-reorder_impl_items: true
22

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

tests/target/impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ impl<K, V, NodeRef: Deref<Target = Node<K, V>>> Handle<NodeRef, handle::Edge, ha
88

99
impl<V> Test<V>
1010
where
11-
V: Clone, // This comment is NOT removed by formating!
11+
V: Clone, // This comment is NOT removed by formatting!
1212
{
1313
pub fn new(value: V) -> Self {
1414
Test {

tests/target/match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ fn issue339() {
149149
n => {}
150150
o => {}
151151
p => {
152-
// Dont collapse me
152+
// Don't collapse me
153153
}
154154
q => {}
155155
r => {}

tests/target/pattern-condense-wildcards.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ fn main() {
77
Tup(_) => "nah",
88
Quad(_, _, x, _) => " also no rewrite",
99
Quad(x, ..) => "condense me pls",
10-
Weird(x, _, _, /* dont condense before */ ..) => "pls work",
10+
Weird(x, _, _, /* don't condense before */ ..) => "pls work",
1111
}
1212
}

tests/target/remove_blank_lines.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn bar() {
2020
let x = 1;
2121
// comment after statement
2222

23-
// comment before statment
23+
// comment before statement
2424
let y = 2;
2525
let z = 3;
2626

tests/target/reorder-impl-items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// rustfmt-reorder_impl_items: true
22

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

0 commit comments

Comments
 (0)