Skip to content

Commit b9b9d6a

Browse files
committed
Change lint name to seek_to_start_instead_of_rewind
- This name makes more sense and highlights the issue Signed-off-by: Doru-Florin Blanzeanu <[email protected]>
1 parent b48a466 commit b9b9d6a

8 files changed

+14
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4195,11 +4195,11 @@ Released 2018-09-13
41954195
[`result_unwrap_used`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unwrap_used
41964196
[`return_self_not_must_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
41974197
[`reversed_empty_ranges`]: https://rust-lang.github.io/rust-clippy/master/index.html#reversed_empty_ranges
4198-
[`rewind_instead_of_seek_to_start`]: https://rust-lang.github.io/rust-clippy/master/index.html#rewind_instead_of_seek_to_start
41994198
[`same_functions_in_if_condition`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_functions_in_if_condition
42004199
[`same_item_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push
42014200
[`same_name_method`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_name_method
42024201
[`search_is_some`]: https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
4202+
[`seek_to_start_instead_of_rewind`]: https://rust-lang.github.io/rust-clippy/master/index.html#seek_to_start_instead_of_rewind
42034203
[`self_assignment`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_assignment
42044204
[`self_named_constructors`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_named_constructors
42054205
[`self_named_module_files`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_named_module_files

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
361361
crate::methods::RANGE_ZIP_WITH_LEN_INFO,
362362
crate::methods::REPEAT_ONCE_INFO,
363363
crate::methods::RESULT_MAP_OR_INTO_OPTION_INFO,
364-
crate::methods::REWIND_INSTEAD_OF_SEEK_TO_START_INFO,
365364
crate::methods::SEARCH_IS_SOME_INFO,
365+
crate::methods::SEEK_TO_START_INSTEAD_OF_REWIND_INFO,
366366
crate::methods::SHOULD_IMPLEMENT_TRAIT_INFO,
367367
crate::methods::SINGLE_CHAR_ADD_STR_INFO,
368368
crate::methods::SINGLE_CHAR_PATTERN_INFO,

clippy_lints/src/methods/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ mod or_then_unwrap;
6868
mod path_buf_push_overwrite;
6969
mod range_zip_with_len;
7070
mod repeat_once;
71-
mod rewind_instead_of_seek_to_start;
7271
mod search_is_some;
72+
mod seek_to_start_instead_of_rewind;
7373
mod single_char_add_str;
7474
mod single_char_insert_string;
7575
mod single_char_pattern;
@@ -3093,7 +3093,7 @@ declare_clippy_lint! {
30933093
/// }
30943094
/// ```
30953095
#[clippy::version = "1.66.0"]
3096-
pub REWIND_INSTEAD_OF_SEEK_TO_START,
3096+
pub SEEK_TO_START_INSTEAD_OF_REWIND,
30973097
complexity,
30983098
"jumping to the start of stream using `seek` method"
30993099
}
@@ -3222,7 +3222,7 @@ impl_lint_pass!(Methods => [
32223222
VEC_RESIZE_TO_ZERO,
32233223
VERBOSE_FILE_READS,
32243224
ITER_KV_MAP,
3225-
REWIND_INSTEAD_OF_SEEK_TO_START,
3225+
SEEK_TO_START_INSTEAD_OF_REWIND,
32263226
]);
32273227

32283228
/// Extracts a method call name, args, and `Span` of the method name.
@@ -3639,7 +3639,7 @@ impl Methods {
36393639
},
36403640
("seek", [arg]) => {
36413641
if meets_msrv(self.msrv, msrvs::SEEK_REWIND) {
3642-
rewind_instead_of_seek_to_start::check(cx, expr, recv, arg, span);
3642+
seek_to_start_instead_of_rewind::check(cx, expr, recv, arg, span);
36433643
}
36443644
},
36453645
("sort", []) => {

clippy_lints/src/methods/rewind_instead_of_seek_to_start.rs renamed to clippy_lints/src/methods/seek_to_start_instead_of_rewind.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_hir::{Expr, ExprKind};
77
use rustc_lint::LateContext;
88
use rustc_span::Span;
99

10-
use super::REWIND_INSTEAD_OF_SEEK_TO_START;
10+
use super::SEEK_TO_START_INSTEAD_OF_REWIND;
1111

1212
pub(super) fn check<'tcx>(
1313
cx: &LateContext<'tcx>,
@@ -32,7 +32,7 @@ pub(super) fn check<'tcx>(
3232
let method_call_span = expr.span.with_lo(name_span.lo());
3333
span_lint_and_then(
3434
cx,
35-
REWIND_INSTEAD_OF_SEEK_TO_START,
35+
SEEK_TO_START_INSTEAD_OF_REWIND,
3636
method_call_span,
3737
"used `seek` to go to the start of the stream",
3838
|diag| {

tests/ui/rewind_instead_of_seek_to_start.fixed renamed to tests/ui/seek_to_start_instead_of_rewind.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-rustfix
22
#![allow(unused)]
33
#![feature(custom_inner_attributes)]
4-
#![warn(clippy::rewind_instead_of_seek_to_start)]
4+
#![warn(clippy::seek_to_start_instead_of_rewind)]
55

66
use std::fs::OpenOptions;
77
use std::io::{Read, Seek, SeekFrom, Write};

tests/ui/rewind_instead_of_seek_to_start.rs renamed to tests/ui/seek_to_start_instead_of_rewind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-rustfix
22
#![allow(unused)]
33
#![feature(custom_inner_attributes)]
4-
#![warn(clippy::rewind_instead_of_seek_to_start)]
4+
#![warn(clippy::seek_to_start_instead_of_rewind)]
55

66
use std::fs::OpenOptions;
77
use std::io::{Read, Seek, SeekFrom, Write};

tests/ui/rewind_instead_of_seek_to_start.stderr renamed to tests/ui/seek_to_start_instead_of_rewind.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error: used `seek` to go to the start of the stream
2-
--> $DIR/rewind_instead_of_seek_to_start.rs:54:7
2+
--> $DIR/seek_to_start_instead_of_rewind.rs:54:7
33
|
44
LL | t.seek(SeekFrom::Start(0));
55
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `rewind()`
66
|
7-
= note: `-D clippy::rewind-instead-of-seek-to-start` implied by `-D warnings`
7+
= note: `-D clippy::seek-to-start-instead-of-rewind` implied by `-D warnings`
88

99
error: used `seek` to go to the start of the stream
10-
--> $DIR/rewind_instead_of_seek_to_start.rs:59:7
10+
--> $DIR/seek_to_start_instead_of_rewind.rs:59:7
1111
|
1212
LL | t.seek(SeekFrom::Start(0));
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `rewind()`
1414

1515
error: used `seek` to go to the start of the stream
16-
--> $DIR/rewind_instead_of_seek_to_start.rs:131:7
16+
--> $DIR/seek_to_start_instead_of_rewind.rs:131:7
1717
|
1818
LL | f.seek(SeekFrom::Start(0));
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `rewind()`

0 commit comments

Comments
 (0)