Skip to content

Commit 1020137

Browse files
committed
unnecessary_owned_empty_string -> unnecessary_owned_empty_strings
1 parent a4d1837 commit 1020137

9 files changed

+16
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3650,7 +3650,7 @@ Released 2018-09-13
36503650
[`unnecessary_lazy_evaluations`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
36513651
[`unnecessary_mut_passed`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
36523652
[`unnecessary_operation`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation
3653-
[`unnecessary_owned_empty_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_owned_empty_string
3653+
[`unnecessary_owned_empty_strings`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_owned_empty_strings
36543654
[`unnecessary_self_imports`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_self_imports
36553655
[`unnecessary_sort_by`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by
36563656
[`unnecessary_to_owned`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned

clippy_lints/src/lib.register_all.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
310310
LintId::of(unit_types::UNIT_CMP),
311311
LintId::of(unnamed_address::FN_ADDRESS_COMPARISONS),
312312
LintId::of(unnamed_address::VTABLE_ADDRESS_COMPARISONS),
313-
LintId::of(unnecessary_owned_empty_string::UNNECESSARY_OWNED_EMPTY_STRING),
313+
LintId::of(unnecessary_owned_empty_strings::UNNECESSARY_OWNED_EMPTY_STRINGS),
314314
LintId::of(unnecessary_sort_by::UNNECESSARY_SORT_BY),
315315
LintId::of(unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
316316
LintId::of(unused_io_amount::UNUSED_IO_AMOUNT),

clippy_lints/src/lib.register_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ store.register_lints(&[
523523
unit_types::UNIT_CMP,
524524
unnamed_address::FN_ADDRESS_COMPARISONS,
525525
unnamed_address::VTABLE_ADDRESS_COMPARISONS,
526-
unnecessary_owned_empty_string::UNNECESSARY_OWNED_EMPTY_STRING,
526+
unnecessary_owned_empty_strings::UNNECESSARY_OWNED_EMPTY_STRINGS,
527527
unnecessary_self_imports::UNNECESSARY_SELF_IMPORTS,
528528
unnecessary_sort_by::UNNECESSARY_SORT_BY,
529529
unnecessary_wraps::UNNECESSARY_WRAPS,

clippy_lints/src/lib.register_style.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ store.register_group(true, "clippy::style", Some("clippy_style"), vec![
106106
LintId::of(single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
107107
LintId::of(tabs_in_doc_comments::TABS_IN_DOC_COMMENTS),
108108
LintId::of(to_digit_is_some::TO_DIGIT_IS_SOME),
109-
LintId::of(unnecessary_owned_empty_string::UNNECESSARY_OWNED_EMPTY_STRING),
109+
LintId::of(unnecessary_owned_empty_strings::UNNECESSARY_OWNED_EMPTY_STRINGS),
110110
LintId::of(unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
111111
LintId::of(unused_unit::UNUSED_UNIT),
112112
LintId::of(upper_case_acronyms::UPPER_CASE_ACRONYMS),

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ mod unit_hash;
383383
mod unit_return_expecting_ord;
384384
mod unit_types;
385385
mod unnamed_address;
386-
mod unnecessary_owned_empty_string;
386+
mod unnecessary_owned_empty_strings;
387387
mod unnecessary_self_imports;
388388
mod unnecessary_sort_by;
389389
mod unnecessary_wraps;
@@ -869,7 +869,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
869869
});
870870
store.register_early_pass(|| Box::new(crate_in_macro_def::CrateInMacroDef));
871871
store.register_early_pass(|| Box::new(empty_structs_with_brackets::EmptyStructsWithBrackets));
872-
store.register_late_pass(|| Box::new(unnecessary_owned_empty_string::UnnecessaryOwnedEmptyString));
872+
store.register_late_pass(|| Box::new(unnecessary_owned_empty_strings::UnnecessaryOwnedEmptyStrings));
873873
// add lints here, do not remove this comment, it's used in `new_lint`
874874
}
875875

clippy_lints/src/unnecessary_owned_empty_string.rs renamed to clippy_lints/src/unnecessary_owned_empty_strings.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ declare_clippy_lint! {
2727
/// vec!["1", "2", "3"].join("");
2828
/// ```
2929
#[clippy::version = "1.62.0"]
30-
pub UNNECESSARY_OWNED_EMPTY_STRING,
30+
pub UNNECESSARY_OWNED_EMPTY_STRINGS,
3131
style,
3232
"detects cases of references to owned empty strings being passed as an argument to a function expecting `&str`"
3333
}
34-
declare_lint_pass!(UnnecessaryOwnedEmptyString => [UNNECESSARY_OWNED_EMPTY_STRING]);
34+
declare_lint_pass!(UnnecessaryOwnedEmptyStrings => [UNNECESSARY_OWNED_EMPTY_STRINGS]);
3535

36-
impl<'tcx> LateLintPass<'tcx> for UnnecessaryOwnedEmptyString {
36+
impl<'tcx> LateLintPass<'tcx> for UnnecessaryOwnedEmptyStrings {
3737
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
3838
if_chain! {
3939
if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner_expr) = expr.kind;
@@ -46,7 +46,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryOwnedEmptyString {
4646
if match_def_path(cx, fun_def_id, &paths::STRING_NEW) {
4747
span_lint_and_sugg(
4848
cx,
49-
UNNECESSARY_OWNED_EMPTY_STRING,
49+
UNNECESSARY_OWNED_EMPTY_STRINGS,
5050
expr.span,
5151
"usage of `&String::new()` for a function expecting a `&str` argument",
5252
"try",
@@ -65,7 +65,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryOwnedEmptyString {
6565
then {
6666
span_lint_and_sugg(
6767
cx,
68-
UNNECESSARY_OWNED_EMPTY_STRING,
68+
UNNECESSARY_OWNED_EMPTY_STRINGS,
6969
expr.span,
7070
"usage of `&String::from(\"\")` for a function expecting a `&str` argument",
7171
"try",

tests/ui/unnecessary_owned_empty_string.fixed renamed to tests/ui/unnecessary_owned_empty_strings.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22

3-
#![warn(clippy::unnecessary_owned_empty_string)]
3+
#![warn(clippy::unnecessary_owned_empty_strings)]
44

55
fn ref_str_argument(_value: &str) {}
66

tests/ui/unnecessary_owned_empty_string.rs renamed to tests/ui/unnecessary_owned_empty_strings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22

3-
#![warn(clippy::unnecessary_owned_empty_string)]
3+
#![warn(clippy::unnecessary_owned_empty_strings)]
44

55
fn ref_str_argument(_value: &str) {}
66

tests/ui/unnecessary_owned_empty_string.stderr renamed to tests/ui/unnecessary_owned_empty_strings.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: usage of `&String::new()` for a function expecting a `&str` argument
2-
--> $DIR/unnecessary_owned_empty_string.rs:12:22
2+
--> $DIR/unnecessary_owned_empty_strings.rs:12:22
33
|
44
LL | ref_str_argument(&String::new());
55
| ^^^^^^^^^^^^^^ help: try: `""`
66
|
7-
= note: `-D clippy::unnecessary-owned-empty-string` implied by `-D warnings`
7+
= note: `-D clippy::unnecessary-owned-empty-strings` implied by `-D warnings`
88

99
error: usage of `&String::from("")` for a function expecting a `&str` argument
10-
--> $DIR/unnecessary_owned_empty_string.rs:15:22
10+
--> $DIR/unnecessary_owned_empty_strings.rs:15:22
1111
|
1212
LL | ref_str_argument(&String::from(""));
1313
| ^^^^^^^^^^^^^^^^^ help: try: `""`

0 commit comments

Comments
 (0)