1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-05-19 16:58:14 +00:00

refactor: address clippy warnings

This commit is contained in:
Rob Ede 2024-05-06 06:03:44 +01:00
parent bb65628de5
commit c1a6388614
No known key found for this signature in database
GPG key ID: 97C636207D3EF933
6 changed files with 8 additions and 11 deletions

View file

@ -706,7 +706,7 @@ where
req.head_mut().peer_addr = *this.peer_addr;
req.conn_data = this.conn_data.clone();
req.conn_data.clone_from(this.conn_data);
match this.codec.message_type() {
// request has no payload

View file

@ -126,7 +126,7 @@ where
head.headers = parts.headers.into();
head.peer_addr = this.peer_addr;
req.conn_data = this.conn_data.clone();
req.conn_data.clone_from(&this.conn_data);
let fut = this.flow.service.call(req);
let config = this.config.clone();

View file

@ -313,7 +313,8 @@ where
let entry = field_limits
.entry(field.name().to_owned())
.or_insert_with(|| T::limit(field.name()));
limits.field_limit_remaining = entry.to_owned();
limits.field_limit_remaining.clone_from(entry);
T::handle_field(&req, field, &mut limits, &mut state).await?;

View file

@ -154,15 +154,11 @@ impl<T: ResourcePath> Path<T> {
None
}
/// Get matched parameter by name.
/// Returns matched parameter by name.
///
/// If keyed parameter is not available empty string is used as default value.
pub fn query(&self, key: &str) -> &str {
if let Some(s) = self.get(key) {
s
} else {
""
}
self.get(key).unwrap_or_default()
}
/// Return iterator to items in parameter container.

View file

@ -148,7 +148,7 @@ impl AppConfig {
#[cfg(test)]
pub(crate) fn set_host(&mut self, host: &str) {
self.host = host.to_owned();
host.clone_into(&mut self.host);
}
}

View file

@ -771,7 +771,7 @@ mod tests {
data3: web::Data<f64>| {
assert_eq!(**data1, 10);
assert_eq!(**data2, '*');
let error = std::f64::EPSILON;
let error = f64::EPSILON;
assert!((**data3 - 1.0).abs() < error);
HttpResponse::Ok()
},