RS.CLIPPY.SEEK_TO_START_INSTEAD_OF_REWIND
Jumping to the start of stream using `seek` method
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: seek_to_start_instead_of_rewind. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for jumps to the start of a stream that implements Seek
and uses the seek method providing Start as parameter.
Why is this bad?
Readability. There is a specific method that was implemented for this exact scenario.
Example
fn foo<T: io::Seek>(t: &mut T) {
t.seek(io::SeekFrom::Start(0));
}
Use instead:
fn foo<T: io::Seek>(t: &mut T) {
t.rewind();
}