Skip to content

Commit 20b4014

Browse files
committed
lint
1 parent 703563f commit 20b4014

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ impl AppVars {
2020
pub fn new() -> Self {
2121
let shortname = env!("CARGO_PKG_NAME");
2222
let name = shortname
23-
.split("-")
23+
.split('-')
2424
.map(capitalize)
2525
.collect::<Vec<String>>()
2626
.join(" ");
2727
let authors: Vec<String> = env!("CARGO_PKG_AUTHORS")
28-
.split(":")
28+
.split(':')
2929
.map(|s| s.to_string())
3030
.collect();
3131

src/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl Throttle {
4949

5050
fn flush(&mut self) {
5151
while let Some(first) = self.deque.front() {
52-
if first.elapsed() >= self.timeout.clone() {
52+
if first.elapsed() >= self.timeout {
5353
self.deque.pop_front();
5454
} else {
5555
break;
@@ -68,8 +68,8 @@ impl Throttle {
6868

6969
pub fn accept(&mut self) -> Result<(), Instant> {
7070
self.flush();
71-
if self.deque.len() >= 1 {
72-
return Err(self.deque.front().unwrap().clone() + self.timeout.clone());
71+
if !self.deque.is_empty() {
72+
return Err(*self.deque.front().unwrap() + self.timeout);
7373
}
7474

7575
self.deque.push_back(Instant::now());

0 commit comments

Comments
 (0)