-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Activate more lints #3394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Activate more lints #3394
Changes from all commits
ede4d85
8a561f3
276e924
3b62dfd
a0f8a48
ddf5830
d8b6ef2
5fa5f5c
869e219
433b705
d8389ac
f61e16f
369f12d
f54a098
e5973a2
f978792
1925041
0365e0b
5990804
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ impl Error { | |
} | ||
|
||
/// Convert an `Error` back into the underlying boxed trait object. | ||
#[must_use] | ||
pub fn into_inner(self) -> BoxError { | ||
Comment on lines
+19
to
20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For errors (and possibly other cases such as builders) we might want to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure how to avoid |
||
self.inner | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,7 @@ macro_rules! __define_rejection { | |
} | ||
|
||
/// Get the status code used for this rejection. | ||
pub fn status(&self) -> http::StatusCode { | ||
pub const fn status(&self) -> http::StatusCode { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think most of these really make sense. I don't think anyone would build a rejection in a const context to then call this. I did not go through all of this commit though, there might be some useful ones here, but this lint might also be one to split out of this PR. |
||
http::StatusCode::$status | ||
} | ||
} | ||
|
@@ -106,12 +106,14 @@ macro_rules! __define_rejection { | |
} | ||
|
||
/// Get the response body text used for this rejection. | ||
#[must_use] | ||
pub fn body_text(&self) -> String { | ||
self.to_string() | ||
} | ||
|
||
/// Get the status code used for this rejection. | ||
pub fn status(&self) -> http::StatusCode { | ||
#[must_use] | ||
pub const fn status(&self) -> http::StatusCode { | ||
http::StatusCode::$status | ||
} | ||
} | ||
|
@@ -179,6 +181,7 @@ macro_rules! __composite_rejection { | |
|
||
impl $name { | ||
/// Get the response body text used for this rejection. | ||
#[must_use] | ||
pub fn body_text(&self) -> String { | ||
match self { | ||
$( | ||
|
@@ -188,7 +191,8 @@ macro_rules! __composite_rejection { | |
} | ||
|
||
/// Get the status code used for this rejection. | ||
pub fn status(&self) -> http::StatusCode { | ||
#[must_use] | ||
pub const fn status(&self) -> http::StatusCode { | ||
match self { | ||
$( | ||
Self::$variant(inner) => inner.status(), | ||
|
Uh oh!
There was an error while loading. Please reload this page.