Skip to content

Commit eb77c4e

Browse files
authored
chore: fix clippy errors (#560)
1 parent 5b3f957 commit eb77c4e

3 files changed

Lines changed: 5 additions & 11 deletions

File tree

cot/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1578,7 +1578,7 @@ impl From<Expiry> for tower_sessions::Expiry {
15781578
Expiry::OnSessionEnd => Self::OnSessionEnd,
15791579
Expiry::OnInactivity(duration) => {
15801580
Self::OnInactivity(time::Duration::try_from(duration).unwrap_or_else(|e| {
1581-
panic!("could not convert {duration:?} into a valid time::Duration: {e:?}",)
1581+
panic!("could not convert {duration:?} into a valid time::Duration: {e:?}")
15821582
}))
15831583
}
15841584
Expiry::AtDateTime(time) => {

cot/src/db.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,11 +1180,9 @@ impl Database {
11801180
});
11811181
}
11821182

1183-
let batch_size = if num_value_fields > 0 {
1184-
max_params / num_value_fields
1185-
} else {
1186-
return Err(DatabaseError::BulkInsertNoValueColumns);
1187-
};
1183+
let batch_size = max_params
1184+
.checked_div(num_value_fields)
1185+
.ok_or(DatabaseError::BulkInsertNoValueColumns)?;
11881186

11891187
for chunk in data.chunks_mut(batch_size) {
11901188
self.bulk_insert_chunk(

cot/src/router/path.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ impl PathMatcher {
3636
.chain([None])
3737
.enumerate()
3838
.peekable();
39-
loop {
40-
let Some((index, ch)) = char_iter.next() else {
41-
break;
42-
};
43-
39+
while let Some((index, ch)) = char_iter.next() {
4440
match (ch, state) {
4541
(Some('{') | None, State::Literal { start }) => {
4642
let literal = &path_pattern[start..index];

0 commit comments

Comments
 (0)