Skip to content

Commit

Permalink
Cargo fmt is now updated for the whole project (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
Muqito authored and kdy1 committed Jan 25, 2020
1 parent 7e00258 commit adf8ac3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions examples/rejections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ async fn main() {

/// Extract a denominator from a "div-by" header, or reject with DivideByZero.
fn div_by() -> impl Filter<Extract = (NonZeroU16,), Error = Rejection> + Copy {
rweb::header::<u16>("div-by").and_then(|n: u16| async move {
if let Some(denom) = NonZeroU16::new(n) {
Ok(denom)
} else {
Err(reject::custom(DivideByZero))
rweb::header::<u16>("div-by").and_then(|n: u16| {
async move {
if let Some(denom) = NonZeroU16::new(n) {
Ok(denom)
} else {
Err(reject::custom(DivideByZero))
}
}
})
}
Expand Down

0 comments on commit adf8ac3

Please sign in to comment.