You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library: mark more functions that return String as #[must_use]
If the return value (String) of the function is not used, the function call is technically in vain
(unless there are side effects) and the entire function call could be ommitted.
Warn about unused return values of -> String functions.
Example code:
let mut x = Sting::from("hello");
x.push_str(" world!");
x.to_uppercase();
println!("{}", x);
will print "hello world!" instead of "HELLO WORLD!") because the result of .to_uppercase() is not caught
in a variable.
std::str::to_lowercase()
std::str::to_uppercase()
std::str::escape_debug()
std::str::escape_default()
std::str::escape_unicode()
std::str::into_string()
std::str::repeat()
std::str::to_ascii_uppercase()
std::str::to_ascii_lowercase()
std::String::with_capacity()
std::String::from_str()
std::String::from_utf16_lossy()
std::String::from_raw_parts()
std::String::from_utf8_unchecked()
std::String::split_off()
0 commit comments