Skip to content

Commit

Permalink
chore: disallow "e" bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Aug 10, 2024
1 parent 5ec1f08 commit 1c09761
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
disallowed-names = [
"e", # no single letter error bindings
]
2 changes: 1 addition & 1 deletion actix-web-lab/src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ impl<T: DeserializeOwned, const LIMIT: usize> Future for JsonBody<T, LIMIT> {
}
},

JsonBody::Error(e) => Poll::Ready(Err(e.take().unwrap())),
JsonBody::Error(err) => Poll::Ready(Err(err.take().unwrap())),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions actix-web-lab/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ impl<T: DeserializeOwned> FromRequest for Query<T> {
fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future {
serde_html_form::from_str::<T>(req.query_string())
.map(|val| ready(Ok(Query(val))))
.unwrap_or_else(move |e| {
let err = QueryPayloadError::Deserialize(e);
.unwrap_or_else(move |err| {
let err = QueryPayloadError::Deserialize(err);

debug!(
"Failed during Query extractor deserialization. \
Expand Down
2 changes: 1 addition & 1 deletion actix-web-lab/src/url_encoded_form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl<T: DeserializeOwned, const LIMIT: usize> Future for UrlEncodedFormBody<T, L
}
},

UrlEncodedFormBody::Error(e) => Poll::Ready(Err(e.take().unwrap())),
UrlEncodedFormBody::Error(err) => Poll::Ready(Err(err.take().unwrap())),
}
}
}
Expand Down

0 comments on commit 1c09761

Please sign in to comment.