Skip to content

Commit

Permalink
Fix code formatting and example tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jespersm committed Sep 20, 2023
1 parent bad92b4 commit 8faaff9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/lib/src/router/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Router {
.any(|route| paths_match(route, req) && queries_match(route, req))
}

const ALL_METHODS: &[Method] = &[
const ALL_METHODS: &'static [Method] = &[
Method::Get, Method::Put, Method::Post, Method::Delete, Method::Options,
Method::Head, Method::Trace, Method::Connect, Method::Patch,
];
Expand Down
3 changes: 1 addition & 2 deletions examples/responders/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ fn test_xml() {
assert_eq!(r.into_string().unwrap(), r#"{ "payload": "I'm here" }"#);

let r = client.get(uri!(super::xml)).header(Accept::CSV).dispatch();
assert_eq!(r.status(), Status::NotFound);
assert!(r.into_string().unwrap().contains("not supported"));
assert_eq!(r.status(), Status::NotAcceptable);

let r = client.get("/content/i/dont/exist").header(Accept::HTML).dispatch();
assert_eq!(r.content_type().unwrap(), ContentType::HTML);
Expand Down
3 changes: 1 addition & 2 deletions examples/templating/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ fn test_root(kind: &str) {
let expected = Template::show(client.rocket(), format!("{}/error/404", kind), &context);

let response = client.req(*method, format!("/{}", kind)).dispatch();
assert_eq!(response.status(), Status::NotFound);
assert_eq!(response.into_string(), expected);
assert_eq!(response.status(), Status::MethodNotAllowed);
}
}

Expand Down

0 comments on commit 8faaff9

Please sign in to comment.