Skip to content

Commit 4d3f6c2

Browse files
committed
Fix clippy warnings
1 parent 532379f commit 4d3f6c2

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

adapter/src/dummy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl Adapter for DummyAdapter {
103103

104104
match identity {
105105
Some((id, _)) => Ok(Session {
106-
uid: self.session_tokens[id].clone(),
106+
uid: self.session_tokens[id],
107107
era: 0,
108108
}),
109109
None => Err(AdapterError::Authentication(format!(

sentry/src/db/event_aggregate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ pub async fn insert_event_aggregate(
177177
data.push(EventData {
178178
id: channel_id.to_owned(),
179179
event_type: event_type.clone(),
180-
earner: Some(earner.clone()),
180+
earner: Some(*earner),
181181
event_count: event_count.to_owned(),
182182
event_payout: event_payout.clone(),
183183
});

sentry/src/event_reducer.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ pub(crate) fn reduce(
2727
initial_aggr.events.insert("CLICK".to_owned(), merge);
2828
}
2929
Event::Close => {
30-
let creator = channel.creator.clone();
3130
let close_event = AggregateEvents {
32-
event_counts: Some(vec![(creator.clone(), 1.into())].into_iter().collect()),
33-
event_payouts: vec![(creator, channel.deposit_amount.clone())]
31+
event_counts: Some(vec![(channel.creator, 1.into())].into_iter().collect()),
32+
event_payouts: vec![(channel.creator, channel.deposit_amount.clone())]
3433
.into_iter()
3534
.collect(),
3635
};

sentry/src/routes/event_aggregate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub async fn list_channel_event_aggregates<A: Adapter>(
3232
let from = if channel.spec.validators.find(&auth.uid).is_some() {
3333
None
3434
} else {
35-
Some(auth.uid.clone())
35+
Some(auth.uid)
3636
};
3737

3838
let event_aggregates = list_event_aggregates(

validator_worker/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ async fn validator_tick<A: Adapter + 'static>(
197197
config: &Config,
198198
logger: &Logger,
199199
) -> Result<(ChannelId, Box<dyn Debug>), ValidatorWorkerError<A::AdapterError>> {
200-
let whoami = adapter.whoami().clone();
200+
let whoami = *adapter.whoami();
201201

202202
// Cloning the `Logger` is cheap, see documentation for more info
203203
let sentry = SentryApi::init(adapter, channel.clone(), &config, logger.clone())

validator_worker/src/sentry_interface.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ impl<A: Adapter + 'static> SentryApi<A> {
120120
.spec
121121
.validators
122122
.iter()
123-
.map(|v| v.id.clone())
123+
.map(|v| v.id)
124124
.collect(),
125-
whoami: adapter.whoami().clone(),
125+
whoami: *adapter.whoami(),
126126
}),
127127
}
128128
}
@@ -242,12 +242,12 @@ async fn propagate_to<A: Adapter>(
242242
.json(&body)
243243
.send()
244244
.await
245-
.map_err(|e| (validator.id.clone(), Error::Request(e)))?
245+
.map_err(|e| (validator.id, Error::Request(e)))?
246246
.json()
247247
.await
248-
.map_err(|e| (validator.id.clone(), Error::Request(e)))?;
248+
.map_err(|e| (validator.id, Error::Request(e)))?;
249249

250-
Ok(validator.id.clone())
250+
Ok(validator.id)
251251
}
252252

253253
pub async fn all_channels(

0 commit comments

Comments
 (0)