mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-26 10:27:42 +02:00
clippy
This commit is contained in:
@ -6,7 +6,7 @@ async fn ok_validator(
|
||||
req: ServiceRequest,
|
||||
credentials: BearerAuth,
|
||||
) -> Result<ServiceRequest, (Error, ServiceRequest)> {
|
||||
eprintln!("{:?}", credentials);
|
||||
eprintln!("{credentials:?}");
|
||||
Ok(req)
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ impl fmt::Display for ParseError {
|
||||
match self {
|
||||
ParseError::Invalid => f.write_str("Invalid header value"),
|
||||
ParseError::MissingScheme => f.write_str("Missing authorization scheme"),
|
||||
ParseError::MissingField(field) => write!(f, "Missing header field ({})", field),
|
||||
ParseError::MissingField(field) => write!(f, "Missing header field ({field})"),
|
||||
ParseError::ToStrError(err) => fmt::Display::fmt(err, f),
|
||||
ParseError::Base64DecodeError(err) => fmt::Display::fmt(err, f),
|
||||
ParseError::Utf8Error(err) => fmt::Display::fmt(err, f),
|
||||
|
@ -12,14 +12,14 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn to_bytes() {
|
||||
let b = Bearer::build()
|
||||
let bearer = Bearer::build()
|
||||
.error(Error::InvalidToken)
|
||||
.error_description("Subject 8740827c-2e0a-447b-9716-d73042e4039d not found")
|
||||
.finish();
|
||||
|
||||
assert_eq!(
|
||||
"Bearer error=\"invalid_token\" error_description=\"Subject 8740827c-2e0a-447b-9716-d73042e4039d not found\"",
|
||||
format!("{}", b)
|
||||
format!("{bearer}")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user