Skip to content

Commit cedb7b5

Browse files
authored
Spelling (#5753)
various spelling fixes --------- Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
1 parent 7f44a08 commit cedb7b5

16 files changed

+40
-40
lines changed

CHANGELOG.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
}
2828
```
2929
- Prevent ICE when formatting `vec!{}` [#5735](https://github.com/rust-lang/rustfmt/issues/5735)
30-
- Prevent internal trailing whitespace error when formatting an empty `macro_rules!` defintion e.g. `macro_rules! foo {}` [#5882](https://github.com/rust-lang/rustfmt/issues/5882)
30+
- Prevent internal trailing whitespace error when formatting an empty `macro_rules!` definition e.g. `macro_rules! foo {}` [#5882](https://github.com/rust-lang/rustfmt/issues/5882)
3131
- Formatting doc comment lines that start with `.` or `)` won't be treated as ordered markdown lists because `.` or `)` must be preceded by a number to start an ordered markdown list [#5835](https://github.com/rust-lang/rustfmt/pull/5835)
3232
- Add parenthesis around closures when they're used as method receives, don't have a block body, and end with `.` [#4808](https://github.com/rust-lang/rustfmt/issues/4808)
3333
```rust
@@ -184,7 +184,7 @@
184184

185185
- Simplify the rustfmt help text by eliding the full path to the rustfmt binary path from the usage string when running `rustfmt --help` [#5214](https://github.com/rust-lang/rustfmt/issues/5214)
186186

187-
- Bumped the version for serveral dependencies. Most notably `dirs` `v2.0.1` -> `v4.0.0`. This changed the global user config directory on macOS from `$HOME/Library/Preferences` to `$HOME/Library/Application Support` [#5237](https://github.com/rust-lang/rustfmt/pull/5237)
187+
- Bumped the version for several dependencies. Most notably `dirs` `v2.0.1` -> `v4.0.0`. This changed the global user config directory on macOS from `$HOME/Library/Preferences` to `$HOME/Library/Application Support` [#5237](https://github.com/rust-lang/rustfmt/pull/5237)
188188

189189
### Fixed
190190

@@ -942,7 +942,7 @@ from formatting an attribute #3665
942942

943943
### Fixed
944944

945-
- Do not remove path disambiugator inside macro #3142
945+
- Do not remove path disambiguator inside macro #3142
946946
- Improve handling of Windows newlines #3141
947947
- Fix alignment of a struct's fields (`struct_field_align_threshold` option) with the Visual `indent_style` #3165
948948
- Fix a bug in formatting markdown lists within comments #3172
@@ -1031,7 +1031,7 @@ from formatting an attribute #3665
10311031

10321032
### Changed
10331033

1034-
- Replace '--conifig-help' with '--config=help' cb10e06
1034+
- Replace '--config-help' with '--config=help' cb10e06
10351035
- Improve formatting of slice patterns #2912
10361036

10371037
### Fixed
@@ -1075,7 +1075,7 @@ from formatting an attribute #3665
10751075
- Add max_width option for all heuristics c2ae39e
10761076
- Add config option `format_macro_matchers` to format the metavariable matching patterns in macros 79c5ee8
10771077
- Add config option `format_macro_bodies` to format the bodies of macros 79c5ee8
1078-
- Format exitential type fc307ff
1078+
- Format existential type fc307ff
10791079
- Support raw identifiers in struct expressions f121b1a
10801080
- Format Async block and async function 0b25f60
10811081

@@ -1131,7 +1131,7 @@ from formatting an attribute #3665
11311131

11321132
### Changed
11331133

1134-
- Update rustc-ap-syntax to 128.0.0 and ustc-ap-rustc_target to 128.0.0 195395f
1134+
- Update rustc-ap-syntax to 128.0.0 and rustc-ap-rustc_target to 128.0.0 195395f
11351135
- Put operands on its own line when each fits in a single line f8439ce
11361136
- Improve CLI options 55ac062 1869888 798bffb 4d9de48 eca7796 8396da1 5d9f5aa
11371137

@@ -1195,7 +1195,7 @@ from formatting an attribute #3665
11951195
- Do not collapse block around expr with condition on match arm 5b9b7d5
11961196
- Use vertical layout for complex attributes c77708f
11971197
- Format array using heuristics for function calls 98c6f7b
1198-
- Implement stable ordering for impl items with the the following item priority: type, const, macro, then method fa80ddf
1198+
- Implement stable ordering for impl items with the following item priority: type, const, macro, then method fa80ddf
11991199
- Reorder imports by default 164cf7d
12001200
- Group `extern crate` by default 3a138a2
12011201
- Make `error_on_line_overflow` false by default f146711

Configurations.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1673,7 +1673,7 @@ use core::slice;
16731673

16741674
Controls whether arm bodies are wrapped in cases where the first line of the body cannot fit on the same line as the `=>` operator.
16751675

1676-
The Style Guide requires that bodies are block wrapped by default if a line break is required after the `=>`, but this option can be used to disable that behavior to prevent wrapping arm bodies in that event, so long as the body does not contain multiple statements nor line comments.
1676+
The Style Guide requires that bodies are block wrapped by default if a line break is required after the `=>`, but this option can be used to disable that behavior to prevent wrapping arm bodies in that event, so long as the body contains neither multiple statements nor line comments.
16771677

16781678
- **Default value**: `true`
16791679
- **Possible values**: `true`, `false`

Processes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ In this Section, we describe how to stabilise an option of the rustfmt's configu
1616
Open a pull request that closes the tracking issue. The tracking issue is listed beside the option in `Configurations.md`.
1717

1818
- Update the `Config` enum marking the option as stable.
19-
- Update the the `Configuration.md` file marking the option as stable.
19+
- Update the `Configuration.md` file marking the option as stable.
2020
- Update `CHANGELOG.md` marking the option as stable.
2121

2222
## After the stabilisation

ci/check_diff.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function clone_repo() {
2828
GIT_TERMINAL_PROMPT=0 git clone --quiet $1 --depth 1 $2 && cd $2
2929
}
3030

31-
# Initialize Git submoduels for the repo.
31+
# Initialize Git submodules for the repo.
3232
#
3333
# Parameters
3434
# $1: list of directories to initialize
@@ -43,7 +43,7 @@ function init_submodules() {
4343
# $2: Output file path for the diff
4444
# $3: Any additional configuration options to pass to rustfmt
4545
#
46-
# Globlas:
46+
# Globals:
4747
# $OPTIONAL_RUSTFMT_CONFIGS: Optional configs passed to the script from $4
4848
function create_diff() {
4949
local config;
@@ -64,7 +64,7 @@ function create_diff() {
6464
# Parameters
6565
# $1: Name of the repository (used for logging)
6666
#
67-
# Globlas:
67+
# Globals:
6868
# $RUSFMT_BIN: Path to the rustfmt master binary. Created when running `compile_rustfmt`
6969
# $FEATURE_BIN: Path to the rustfmt feature binary. Created when running `compile_rustfmt`
7070
# $OPTIONAL_RUSTFMT_CONFIGS: Optional configs passed to the script from $4
@@ -101,7 +101,7 @@ function check_diff() {
101101
# Parameters:
102102
# $1: Directory where rustfmt will be cloned
103103
#
104-
# Globlas:
104+
# Globals:
105105
# $REMOTE_REPO: Clone URL to the rustfmt fork that we want to test
106106
# $FEATURE_BRANCH: Name of the feature branch
107107
# $OPTIONAL_COMMIT_HASH: Optional commit hash that will be checked out if provided
@@ -111,8 +111,8 @@ function compile_rustfmt() {
111111
git remote add feature $REMOTE_REPO
112112
git fetch feature $FEATURE_BRANCH
113113

114-
CARGO_VERSON=$(cargo --version)
115-
echo -e "\ncompiling with $CARGO_VERSON\n"
114+
CARGO_VERSION=$(cargo --version)
115+
echo -e "\ncompiling with $CARGO_VERSION\n"
116116

117117
# Because we're building standalone binaries we need to set `LD_LIBRARY_PATH` so each
118118
# binary can find it's runtime dependencies. See https://github.com/rust-lang/rustfmt/issues/5675

intellij.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- Open Rustfmt settings (File → Settings → Languages & Frameworks → Rust → Rustfmt) and enable "Run rustfmt on Save"
2121
![run_rustfmt_on_save](https://user-images.githubusercontent.com/6505554/83944610-3468f380-a81e-11ea-9c34-0cbd18dd4969.png)
2222

23-
- IntellJ uses autosave, so now your files will always be formatted according to rustfmt. Alternatively you can use Ctrl+S to reformat file manually
23+
- IntelliJ uses autosave, so now your files will always be formatted according to rustfmt. Alternatively you can use Ctrl+S to reformat file manually
2424

2525
### Bind shortcut to "Reformat File with Rustfmt" action
2626

src/comment.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ pub(crate) fn combine_strs_with_missing_comments(
205205

206206
// We have a missing comment between the first expression and the second expression.
207207

208-
// Peek the the original source code and find out whether there is a newline between the first
208+
// Peek the original source code and find out whether there is a newline between the first
209209
// expression and the second expression or the missing comment. We will preserve the original
210210
// layout whenever possible.
211211
let original_snippet = context.snippet(span);
@@ -663,7 +663,7 @@ impl<'a> CommentRewrite<'a> {
663663
}
664664

665665
/// Check if any characters were written to the result buffer after the start of the comment.
666-
/// when calling [`CommentRewrite::new()`] the result buffer is initiazlied with the opening
666+
/// when calling [`CommentRewrite::new()`] the result buffer is initialized with the opening
667667
/// characters for the comment.
668668
fn buffer_contains_comment(&self) -> bool {
669669
// if self.result.len() < self.opener.len() then an empty comment is in the buffer
@@ -1260,15 +1260,15 @@ pub(crate) enum FullCodeCharKind {
12601260
InComment,
12611261
/// Last character of a comment, '\n' for a line comment, '/' for a block comment.
12621262
EndComment,
1263-
/// Start of a mutlitine string inside a comment
1263+
/// Start of a multiline string inside a comment
12641264
StartStringCommented,
1265-
/// End of a mutlitine string inside a comment
1265+
/// End of a multiline string inside a comment
12661266
EndStringCommented,
12671267
/// Inside a commented string
12681268
InStringCommented,
1269-
/// Start of a mutlitine string
1269+
/// Start of a multiline string
12701270
StartString,
1271-
/// End of a mutlitine string
1271+
/// End of a multiline string
12721272
EndString,
12731273
/// Inside a string.
12741274
InString,

src/config/config_type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl ConfigType for IgnoreList {
6666
}
6767

6868
macro_rules! create_config {
69-
// Options passed in to the macro.
69+
// Options passed into the macro.
7070
//
7171
// - $i: the ident name of the option
7272
// - $ty: the type of the option value

src/config/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ impl Config {
287287
}
288288
}
289289

290-
// If none was found ther either, check in the user's configuration directory.
290+
// If none was found there either, check in the user's configuration directory.
291291
if let Some(mut config_dir) = dirs::config_dir() {
292292
config_dir.push("rustfmt");
293293
if let Some(path) = get_toml_path(&config_dir)? {

src/config/options.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub enum Color {
191191
pub enum Version {
192192
/// 1.x.y. When specified, rustfmt will format in the same style as 1.0.0.
193193
One,
194-
/// 2.x.y. When specified, rustfmt will format in the the latest style.
194+
/// 2.x.y. When specified, rustfmt will format in the latest style.
195195
Two,
196196
}
197197

@@ -416,7 +416,7 @@ pub trait CliOptions {
416416
fn config_path(&self) -> Option<&Path>;
417417
}
418418

419-
/// The edition of the syntax and semntics of code (RFC 2052).
419+
/// The edition of the syntax and semantics of code (RFC 2052).
420420
#[config_type]
421421
pub enum Edition {
422422
#[value = "2015"]

src/imports.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -683,9 +683,9 @@ impl UseTree {
683683
let prefix = &self.path[..self.path.len() - 1];
684684
let mut result = vec![];
685685
for nested_use_tree in list {
686-
for flattend in &mut nested_use_tree.clone().flatten(import_granularity) {
686+
for flattened in &mut nested_use_tree.clone().flatten(import_granularity) {
687687
let mut new_path = prefix.to_vec();
688-
new_path.append(&mut flattend.path);
688+
new_path.append(&mut flattened.path);
689689
result.push(UseTree {
690690
path: new_path,
691691
span: self.span,

src/items.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2506,7 +2506,7 @@ fn rewrite_fn_base(
25062506
|| context.config.indent_style() == IndentStyle::Visual
25072507
{
25082508
let indent = if param_str.is_empty() {
2509-
// Aligning with non-existent params looks silly.
2509+
// Aligning with nonexistent params looks silly.
25102510
force_new_line_for_brace = true;
25112511
indent + 4
25122512
} else {
@@ -2521,7 +2521,7 @@ fn rewrite_fn_base(
25212521
} else {
25222522
let mut ret_shape = Shape::indented(indent, context.config);
25232523
if param_str.is_empty() {
2524-
// Aligning with non-existent params looks silly.
2524+
// Aligning with nonexistent params looks silly.
25252525
force_new_line_for_brace = true;
25262526
ret_shape = if context.use_block_indent() {
25272527
ret_shape.offset_left(4).unwrap_or(ret_shape)

src/matches.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,10 @@ fn flatten_arm_body<'a>(
339339
(true, body)
340340
}
341341
} else {
342-
let cond_becomes_muti_line = opt_shape
342+
let cond_becomes_multi_line = opt_shape
343343
.and_then(|shape| rewrite_cond(context, expr, shape))
344344
.map_or(false, |cond| cond.contains('\n'));
345-
if cond_becomes_muti_line {
345+
if cond_becomes_multi_line {
346346
(false, &*body)
347347
} else {
348348
(can_extend(expr), &*expr)

src/overflow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ impl<'a> Context<'a> {
523523
// However, when the inner function has a prefix or a suffix
524524
// (e.g., `foo() as u32`), this budget reduction may produce poorly
525525
// formatted code, where a prefix or a suffix being left on its own
526-
// line. Here we explicitlly check those cases.
526+
// line. Here we explicitly check those cases.
527527
if count_newlines(overflowed) == 1 {
528528
let rw = self
529529
.items

src/parse/session.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct SilentOnIgnoredFilesEmitter {
6262
}
6363

6464
impl SilentOnIgnoredFilesEmitter {
65-
fn handle_non_ignoreable_error(&mut self, db: &Diagnostic) {
65+
fn handle_non_ignorable_error(&mut self, db: &Diagnostic) {
6666
self.has_non_ignorable_parser_errors = true;
6767
self.can_reset.store(false, Ordering::Release);
6868
self.emitter.emit_diagnostic(db);
@@ -86,7 +86,7 @@ impl Emitter for SilentOnIgnoredFilesEmitter {
8686

8787
fn emit_diagnostic(&mut self, db: &Diagnostic) {
8888
if db.level() == DiagnosticLevel::Fatal {
89-
return self.handle_non_ignoreable_error(db);
89+
return self.handle_non_ignorable_error(db);
9090
}
9191
if let Some(primary_span) = &db.span.primary_span() {
9292
let file_name = self.source_map.span_to_filename(*primary_span);
@@ -104,7 +104,7 @@ impl Emitter for SilentOnIgnoredFilesEmitter {
104104
}
105105
};
106106
}
107-
self.handle_non_ignoreable_error(db);
107+
self.handle_non_ignorable_error(db);
108108
}
109109
}
110110

@@ -179,7 +179,7 @@ impl ParseSess {
179179
///
180180
/// * `id` - The name of the module
181181
/// * `relative` - If Some(symbol), the symbol name is a directory relative to the dir_path.
182-
/// If relative is Some, resolve the submodle at {dir_path}/{symbol}/{id}.rs
182+
/// If relative is Some, resolve the submodule at {dir_path}/{symbol}/{id}.rs
183183
/// or {dir_path}/{symbol}/{id}/mod.rs. if None, resolve the module at {dir_path}/{id}.rs.
184184
/// * `dir_path` - Module resolution will occur relative to this directory.
185185
pub(crate) fn default_submod_path(
@@ -190,7 +190,7 @@ impl ParseSess {
190190
) -> Result<ModulePathSuccess, ModError<'_>> {
191191
rustc_expand::module::default_submod_path(&self.parse_sess, id, relative, dir_path).or_else(
192192
|e| {
193-
// If resloving a module relative to {dir_path}/{symbol} fails because a file
193+
// If resolving a module relative to {dir_path}/{symbol} fails because a file
194194
// could not be found, then try to resolve the module relative to {dir_path}.
195195
// If we still can't find the module after searching for it in {dir_path},
196196
// surface the original error.

src/test/configuration_snippet.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl ConfigCodeBlock {
208208
}
209209

210210
// Extract a code block from the iterator. Behavior:
211-
// - Rust code blocks are identifed by lines beginning with "```rust".
211+
// - Rust code blocks are identified by lines beginning with "```rust".
212212
// - One explicit configuration setting is supported per code block.
213213
// - Rust code blocks with no configuration setting are illegal and cause an
214214
// assertion failure, unless the snippet begins with #![rustfmt::skip].

src/visitor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub(crate) struct FmtVisitor<'a> {
8181
pub(crate) snippet_provider: &'a SnippetProvider,
8282
pub(crate) line_number: usize,
8383
/// List of 1-based line ranges which were annotated with skip
84-
/// Both bounds are inclusifs.
84+
/// Both bounds are inclusive.
8585
pub(crate) skipped_range: Rc<RefCell<Vec<(usize, usize)>>>,
8686
pub(crate) macro_rewrite_failure: bool,
8787
pub(crate) report: FormatReport,

0 commit comments

Comments
 (0)