Skip to content

Commit b32f680

Browse files
authored
Merge pull request #915 from DaraghD/clippy
fix: clippy warnings
2 parents a752efc + f6e3e03 commit b32f680

4 files changed

Lines changed: 4 additions & 5 deletions

File tree

examples/middleware.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const INTERNAL_SERVER_ERROR_HTML_PAGE: &str = "<html><body>
9393
#[async_std::main]
9494
async fn main() -> Result<()> {
9595
femme::start();
96-
let mut app = tide::with_state(UserDatabase::default());
96+
let mut app = tide::with_state(UserDatabase);
9797

9898
app.with(After(|response: Response| async move {
9999
let response = match response.status() {

src/router.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<State: Clone + Send + Sync + 'static> Router<State> {
4545
) {
4646
self.method_map
4747
.entry(method)
48-
.or_insert_with(MethodRouter::new)
48+
.or_default()
4949
.add(path, ep)
5050
.unwrap()
5151
}

tests/route_middleware.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
mod test_utils;
22
use http_types::headers::HeaderName;
3-
use std::convert::TryInto;
43
use test_utils::ServerTestingExt;
54
use tide::Middleware;
65

@@ -9,7 +8,7 @@ struct TestMiddleware(HeaderName, &'static str);
98

109
impl TestMiddleware {
1110
fn with_header_name(name: &'static str, value: &'static str) -> Self {
12-
Self(name.try_into().unwrap(), value)
11+
Self(name.into(), value)
1312
}
1413
}
1514

tests/unix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ mod unix_tests {
55
use async_std::task;
66
use http_types::{url::Url, Request};
77
use std::time::Duration;
8-
use tide::Method;
98
use tempfile::tempdir;
9+
use tide::Method;
1010

1111
#[test]
1212
fn hello_unix_world() -> Result<(), http_types::Error> {

0 commit comments

Comments
 (0)