Convert len() > 0 to ! is_empty()
`cargo clippy` suggested to use `is_empty()` instead of `len() > 0`, because this doesn't require to calculate the whole length of the sequence. See: <https://rust-lang.github.io/rust-clippy/master/index.html#len_zero>
This commit is contained in:
committed by
Jan Alexander Steffens (heftig)
parent
f9d3570363
commit
846ec8f898
@@ -255,7 +255,7 @@ fn main() {
|
||||
sg
|
||||
)
|
||||
.unwrap();
|
||||
if new_entry.state_map.len() > 0 {
|
||||
if !new_entry.state_map.is_empty() {
|
||||
writeln!(output, "INSERT INTO state_groups_state (state_group, room_id, type, state_key, event_id) VALUES").unwrap();
|
||||
let mut first = true;
|
||||
for ((t, s), e) in new_entry.state_map.iter() {
|
||||
|
||||
Reference in New Issue
Block a user