""
or []
when .is_empty()
could be used RS-W1102The intent expressed by .is_empty()
is a lot clearer than comparison to ""
or []
. Prefer .is_empty()
where applicable.
let s = "hello";
if s == "" {
// ...
}
let s = "hello";
if s.is_empty() {
// ...
}