-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Declutter statements #3408
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?
Declutter statements #3408
Changes from all commits
ffd3c1e
77ef0da
11eb562
4b25331
956dd25
1f9b929
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 |
---|---|---|
|
@@ -460,7 +460,7 @@ impl<'de> Deserializer<'de> for ValueDeserializer<'de> { | |
)); | ||
} | ||
None => {} | ||
}; | ||
} | ||
|
||
self.value | ||
.take() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -835,12 +835,11 @@ where | |
S: Clone, | ||
{ | ||
if endpoint_filter.contains(filter) { | ||
if out.is_some() { | ||
panic!( | ||
"Overlapping method route. Cannot add two method routes that both handle \ | ||
assert!( | ||
!out.is_some(), | ||
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.
|
||
"Overlapping method route. Cannot add two method routes that both handle \ | ||
`{method_name}`", | ||
Comment on lines
+840
to
841
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. Does this fit the line as a single line string literal now? If no, please reduce indentation on the second line by 4 spaces. |
||
) | ||
} | ||
); | ||
*out = endpoint.clone(); | ||
for method in methods { | ||
append_allow_header(allow_header, method); | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -203,9 +203,10 @@ where | |||||
#[doc(alias = "scope")] // Some web frameworks like actix-web use this term | ||||||
#[track_caller] | ||||||
pub fn nest(self, path: &str, router: Self) -> Self { | ||||||
if path.is_empty() || path == "/" { | ||||||
panic!("Nesting at the root is no longer supported. Use merge instead."); | ||||||
} | ||||||
assert!( | ||||||
!(path.is_empty() || path == "/"), | ||||||
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.
Suggested change
|
||||||
"Nesting at the root is no longer supported. Use merge instead." | ||||||
); | ||||||
|
||||||
let RouterInner { | ||||||
path_router, | ||||||
|
@@ -229,9 +230,10 @@ where | |||||
T::Response: IntoResponse, | ||||||
T::Future: Send + 'static, | ||||||
{ | ||||||
if path.is_empty() || path == "/" { | ||||||
panic!("Nesting at the root is no longer supported. Use fallback_service instead."); | ||||||
} | ||||||
assert!( | ||||||
!(path.is_empty() || path == "/"), | ||||||
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.
Suggested change
|
||||||
"Nesting at the root is no longer supported. Use fallback_service instead." | ||||||
); | ||||||
|
||||||
tap_inner!(self, mut this => { | ||||||
panic_on_err!(this.path_router.nest_service(path, service)); | ||||||
|
@@ -264,7 +266,7 @@ where | |||||
(false, false) => { | ||||||
panic!("Cannot merge two `Router`s that both have a fallback") | ||||||
} | ||||||
}; | ||||||
} | ||||||
|
||||||
panic_on_err!(this.path_router.merge(path_router)); | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I commented on this before, but I wouldn't want
assert_eq
here even if it was possible, since it adds a LHS-RHS comparison to the output, which would not be helpful here.