Skip to content

Commit 4e04903

Browse files
committed
rename to plural form
1 parent 220a9db commit 4e04903

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4582,7 +4582,7 @@ Released 2018-09-13
45824582
[`debug_assert_with_mut_call`]: https://rust-lang.github.io/rust-clippy/master/index.html#debug_assert_with_mut_call
45834583
[`decimal_literal_representation`]: https://rust-lang.github.io/rust-clippy/master/index.html#decimal_literal_representation
45844584
[`declare_interior_mutable_const`]: https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
4585-
[`default_constructed_unit_struct`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_struct
4585+
[`default_constructed_unit_structs`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
45864586
[`default_instead_of_iter_empty`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_instead_of_iter_empty
45874587
[`default_numeric_fallback`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
45884588
[`default_trait_access`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
105105
crate::dbg_macro::DBG_MACRO_INFO,
106106
crate::default::DEFAULT_TRAIT_ACCESS_INFO,
107107
crate::default::FIELD_REASSIGN_WITH_DEFAULT_INFO,
108-
crate::default_constructed_unit_struct::DEFAULT_CONSTRUCTED_UNIT_STRUCT_INFO,
108+
crate::default_constructed_unit_structs::DEFAULT_CONSTRUCTED_UNIT_STRUCTS_INFO,
109109
crate::default_instead_of_iter_empty::DEFAULT_INSTEAD_OF_ITER_EMPTY_INFO,
110110
crate::default_numeric_fallback::DEFAULT_NUMERIC_FALLBACK_INFO,
111111
crate::default_union_representation::DEFAULT_UNION_REPRESENTATION_INFO,

clippy_lints/src/default_constructed_unit_struct.rs renamed to clippy_lints/src/default_constructed_unit_structs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ declare_clippy_lint! {
3131
/// }
3232
/// ```
3333
#[clippy::version = "1.71.0"]
34-
pub DEFAULT_CONSTRUCTED_UNIT_STRUCT,
34+
pub DEFAULT_CONSTRUCTED_UNIT_STRUCTS,
3535
complexity,
3636
"unit structs can be contructed without calling `default`"
3737
}
38-
declare_lint_pass!(DefaultConstructedUnitStruct => [DEFAULT_CONSTRUCTED_UNIT_STRUCT]);
38+
declare_lint_pass!(DefaultConstructedUnitStructs => [DEFAULT_CONSTRUCTED_UNIT_STRUCTS]);
3939

40-
impl LateLintPass<'_> for DefaultConstructedUnitStruct {
40+
impl LateLintPass<'_> for DefaultConstructedUnitStructs {
4141
fn check_expr<'tcx>(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) {
4242
if_chain!(
4343
// make sure we have a call to `Default::default`
@@ -53,7 +53,7 @@ impl LateLintPass<'_> for DefaultConstructedUnitStruct {
5353
then {
5454
span_lint_and_sugg(
5555
cx,
56-
DEFAULT_CONSTRUCTED_UNIT_STRUCT,
56+
DEFAULT_CONSTRUCTED_UNIT_STRUCTS,
5757
expr.span.with_lo(qpath.qself_span().hi()),
5858
"use of `default` to create a unit struct",
5959
"remove this call to `default`",

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ mod crate_in_macro_def;
9494
mod create_dir;
9595
mod dbg_macro;
9696
mod default;
97-
mod default_constructed_unit_struct;
97+
mod default_constructed_unit_structs;
9898
mod default_instead_of_iter_empty;
9999
mod default_numeric_fallback;
100100
mod default_union_representation;
@@ -971,7 +971,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
971971
store.register_late_pass(|_| Box::new(manual_slice_size_calculation::ManualSliceSizeCalculation));
972972
store.register_early_pass(|| Box::new(suspicious_doc_comments::SuspiciousDocComments));
973973
store.register_late_pass(|_| Box::new(items_after_test_module::ItemsAfterTestModule));
974-
store.register_late_pass(|_| Box::new(default_constructed_unit_struct::DefaultConstructedUnitStruct));
974+
store.register_late_pass(|_| Box::new(default_constructed_unit_structs::DefaultConstructedUnitStructs));
975975
// add lints here, do not remove this comment, it's used in `new_lint`
976976
}
977977

tests/ui/default_constructed_unit_struct.rs renamed to tests/ui/default_constructed_unit_structs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(unused)]
2-
#![warn(clippy::default_constructed_unit_struct)]
2+
#![warn(clippy::default_constructed_unit_structs)]
33
use std::marker::PhantomData;
44

55
#[derive(Default)]

tests/ui/default_constructed_unit_struct.stderr renamed to tests/ui/default_constructed_unit_structs.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
error: use of `default` to create a unit struct
2-
--> $DIR/default_constructed_unit_struct.rs:39:31
2+
--> $DIR/default_constructed_unit_structs.rs:39:31
33
|
44
LL | inner: PhantomData::default(),
55
| ^^^^^^^^^^^ help: remove this call to `default`
66
|
7-
= note: `-D clippy::default-constructed-unit-struct` implied by `-D warnings`
7+
= note: `-D clippy::default-constructed-unit-structs` implied by `-D warnings`
88

99
error: use of `default` to create a unit struct
10-
--> $DIR/default_constructed_unit_struct.rs:62:33
10+
--> $DIR/default_constructed_unit_structs.rs:62:33
1111
|
1212
LL | let _ = PhantomData::<usize>::default();
1313
| ^^^^^^^^^^^ help: remove this call to `default`
1414

1515
error: use of `default` to create a unit struct
16-
--> $DIR/default_constructed_unit_struct.rs:63:42
16+
--> $DIR/default_constructed_unit_structs.rs:63:42
1717
|
1818
LL | let _: PhantomData<i32> = PhantomData::default();
1919
| ^^^^^^^^^^^ help: remove this call to `default`
2020

2121
error: use of `default` to create a unit struct
22-
--> $DIR/default_constructed_unit_struct.rs:64:23
22+
--> $DIR/default_constructed_unit_structs.rs:64:23
2323
|
2424
LL | let _ = UnitStruct::default();
2525
| ^^^^^^^^^^^ help: remove this call to `default`

0 commit comments

Comments
 (0)