fix a few typos found via codespell.
This commit is contained in:
parent
7d713a2827
commit
b25f974c0d
@ -97,7 +97,7 @@
|
||||
|
||||
### Changed
|
||||
|
||||
- Warn when unkown configuration option is used.
|
||||
- Warn when unknown configuration option is used.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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 {
|
||||
|
@ -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(' ');
|
||||
}
|
||||
|
@ -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()
|
||||
|
@ -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>,
|
||||
|
@ -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
|
||||
|
@ -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() {
|
||||
|
@ -150,7 +150,7 @@ fn issue339() {
|
||||
{
|
||||
|
||||
}
|
||||
p => { // Dont collapse me
|
||||
p => { // Don't collapse me
|
||||
} q => { } r =>
|
||||
{
|
||||
|
||||
|
@ -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",
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ fn bar() {
|
||||
// comment after statement
|
||||
|
||||
|
||||
// comment before statment
|
||||
// comment before statement
|
||||
let y = 2;
|
||||
let z = 3;
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -149,7 +149,7 @@ fn issue339() {
|
||||
n => {}
|
||||
o => {}
|
||||
p => {
|
||||
// Dont collapse me
|
||||
// Don't collapse me
|
||||
}
|
||||
q => {}
|
||||
r => {}
|
||||
|
@ -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",
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ fn bar() {
|
||||
let x = 1;
|
||||
// comment after statement
|
||||
|
||||
// comment before statment
|
||||
// comment before statement
|
||||
let y = 2;
|
||||
let z = 3;
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user