mirror of
https://github.com/fafhrd91/actix-web
synced 2025-07-01 16:55:08 +02:00
fix clippy warnings (#1806)
* fix clippy warnings * prevent CI fail status caused by codecov
This commit is contained in:
@ -192,10 +192,7 @@ impl AcceptEncoding {
|
||||
};
|
||||
let quality = match parts.len() {
|
||||
1 => encoding.quality(),
|
||||
_ => match f64::from_str(parts[1]) {
|
||||
Ok(q) => q,
|
||||
Err(_) => 0.0,
|
||||
},
|
||||
_ => f64::from_str(parts[1]).unwrap_or(0.0),
|
||||
};
|
||||
Some(AcceptEncoding { encoding, quality })
|
||||
}
|
||||
|
@ -105,6 +105,7 @@ mod tests {
|
||||
use crate::test::{self, TestRequest};
|
||||
use crate::HttpResponse;
|
||||
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
fn render_500<B>(mut res: ServiceResponse<B>) -> Result<ErrorHandlerResponse<B>> {
|
||||
res.response_mut()
|
||||
.headers_mut()
|
||||
|
@ -154,6 +154,7 @@ mod tests {
|
||||
use crate::test::{self, TestRequest};
|
||||
use crate::HttpResponse;
|
||||
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
fn render_500<B>(mut res: ServiceResponse<B>) -> Result<ErrorHandlerResponse<B>> {
|
||||
res.response_mut()
|
||||
.headers_mut()
|
||||
|
@ -241,9 +241,10 @@ pub struct PayloadConfig {
|
||||
impl PayloadConfig {
|
||||
/// Create `PayloadConfig` instance and set max size of payload.
|
||||
pub fn new(limit: usize) -> Self {
|
||||
let mut cfg = Self::default();
|
||||
cfg.limit = limit;
|
||||
cfg
|
||||
Self {
|
||||
limit,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
/// Change max size of payload. By default max size is 256Kb
|
||||
|
Reference in New Issue
Block a user