Rust

Rust

By DeepSource

Found use of deprecated function RS-W1128

Bug risk

In Rust, a function can be marked as deprecated to indicate that the function shouldn't be used anymore in the future. Hence, consider avoiding the use of deprecated functions in your code as much as possible.

Bad practice

fn main() {
    std::thread::sleep_ms(10); // bad
}

Recommended

fn main() {
    std::thread::sleep(Duration::from_millis(10)); // fine
}