mirror of https://github.com/http-rs/tide
commit
b32f680d5b
|
@ -93,7 +93,7 @@ const INTERNAL_SERVER_ERROR_HTML_PAGE: &str = "<html><body>
|
|||
#[async_std::main]
|
||||
async fn main() -> Result<()> {
|
||||
femme::start();
|
||||
let mut app = tide::with_state(UserDatabase::default());
|
||||
let mut app = tide::with_state(UserDatabase);
|
||||
|
||||
app.with(After(|response: Response| async move {
|
||||
let response = match response.status() {
|
||||
|
|
|
@ -45,7 +45,7 @@ impl<State: Clone + Send + Sync + 'static> Router<State> {
|
|||
) {
|
||||
self.method_map
|
||||
.entry(method)
|
||||
.or_insert_with(MethodRouter::new)
|
||||
.or_default()
|
||||
.add(path, ep)
|
||||
.unwrap()
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
mod test_utils;
|
||||
use http_types::headers::HeaderName;
|
||||
use std::convert::TryInto;
|
||||
use test_utils::ServerTestingExt;
|
||||
use tide::Middleware;
|
||||
|
||||
|
@ -9,7 +8,7 @@ struct TestMiddleware(HeaderName, &'static str);
|
|||
|
||||
impl TestMiddleware {
|
||||
fn with_header_name(name: &'static str, value: &'static str) -> Self {
|
||||
Self(name.try_into().unwrap(), value)
|
||||
Self(name.into(), value)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@ mod unix_tests {
|
|||
use async_std::task;
|
||||
use http_types::{url::Url, Request};
|
||||
use std::time::Duration;
|
||||
use tide::Method;
|
||||
use tempfile::tempdir;
|
||||
use tide::Method;
|
||||
|
||||
#[test]
|
||||
fn hello_unix_world() -> Result<(), http_types::Error> {
|
||||
|
|
Loading…
Reference in New Issue