Skip to content

Commit b8aab4b

Browse files
committed
Polish missing_enforced_import_renames documentation
* Fixes a typo in the name of the lint (`enforce-import-renames` instead of `enforced-import-renames`). * Copyedit “Why” paragraph. * Make the example configuration use a multi-line list, since it is not particularly expected that a real project will have *exactly one* rename to enforce (and the old formatting had unbalanced whitespace).
1 parent 7343db9 commit b8aab4b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

clippy_lints/src/missing_enforced_import_rename.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,23 @@ use rustc_span::Symbol;
1313
declare_clippy_lint! {
1414
/// ### What it does
1515
/// Checks for imports that do not rename the item as specified
16-
/// in the `enforce-import-renames` config option.
16+
/// in the `enforced-import-renames` config option.
1717
///
1818
/// Note: Even though this lint is warn-by-default, it will only trigger if
19-
/// import renames are defined in the clippy.toml file.
19+
/// import renames are defined in the `clippy.toml` file.
2020
///
2121
/// ### Why is this bad?
22-
/// Consistency is important, if a project has defined import
23-
/// renames they should be followed. More practically, some item names are too
24-
/// vague outside of their defining scope this can enforce a more meaningful naming.
22+
/// Consistency is important; if a project has defined import renames, then they should be
23+
/// followed. More practically, some item names are too vague outside of their defining scope,
24+
/// in which case this can enforce a more meaningful naming.
2525
///
2626
/// ### Example
2727
/// An example clippy.toml configuration:
2828
/// ```toml
2929
/// # clippy.toml
30-
/// enforced-import-renames = [ { path = "serde_json::Value", rename = "JsonValue" }]
30+
/// enforced-import-renames = [
31+
/// { path = "serde_json::Value", rename = "JsonValue" },
32+
/// ]
3133
/// ```
3234
///
3335
/// ```rust,ignore

0 commit comments

Comments
 (0)