Rust

Rust

Made by DeepSource

Found manual implementation of Seek::rewind RS-W1046

Anti-pattern
Minor
Autofix

Calling Seek::seek with SeekFrom::Start(0) as the position is equivalent to Seek::rewind. Consider using Seek::rewind to improve readibility.

Bad practice

fn foo<T: io::Seek>(t: T) {
    t.seek(SeekFrom::Start(0));
}

Recommended

fn foo<T: io::Seek>(t: T) {
    t.rewind();
}