Skip to content

Commit 846ec8f

Browse files
jo-soheftig
authored andcommitted
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>
1 parent f9d3570 commit 846ec8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ fn main() {
255255
sg
256256
)
257257
.unwrap();
258-
if new_entry.state_map.len() > 0 {
258+
if !new_entry.state_map.is_empty() {
259259
writeln!(output, "INSERT INTO state_groups_state (state_group, room_id, type, state_key, event_id) VALUES").unwrap();
260260
let mut first = true;
261261
for ((t, s), e) in new_entry.state_map.iter() {

0 commit comments

Comments
 (0)