diff options
| author | Fuwn <[email protected]> | 2023-04-03 05:16:44 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-04-03 05:16:44 +0000 |
| commit | ee4444549584189390e55594cdb4a1de1ff6ec1a (patch) | |
| tree | 04d3eff689f42dfe5e04c992442b55ecd6687e5d | |
| parent | fix(context): clippy lints (diff) | |
| download | windmark-ee4444549584189390e55594cdb4a1de1ff6ec1a.tar.xz windmark-ee4444549584189390e55594cdb4a1de1ff6ec1a.zip | |
style: seperate blocks
| -rw-r--r-- | examples/windmark.rs | 1 | ||||
| -rw-r--r-- | src/router.rs | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/examples/windmark.rs b/examples/windmark.rs index fd24f84..f6857e5 100644 --- a/examples/windmark.rs +++ b/examples/windmark.rs @@ -32,6 +32,7 @@ use windmark::{ struct Clicker { clicks: isize, } + impl windmark::Module for Clicker { fn on_attach(&mut self, _: &mut Router) { println!("clicker has been attached!"); diff --git a/src/router.rs b/src/router.rs index bd2eaf9..7761e3c 100644 --- a/src/router.rs +++ b/src/router.rs @@ -79,6 +79,7 @@ pub struct Router { modules: Arc<Mutex<Vec<Box<dyn Module + Send>>>>, fix_path: bool, } + impl Router { /// Create a new `Router` /// @@ -290,6 +291,7 @@ impl Router { String::from_utf8(buffer[0..size].to_vec()), "59 The server (Windmark) received a bad request: {}" ); + url = or_error!( stream, url::Url::parse(&request.replace("\r\n", "")), @@ -346,6 +348,7 @@ impl Router { )), )); } + for (i, partial_footer) in { #[allow(clippy::needless_borrow)] (&mut *self.footers.lock().unwrap()).iter_mut().enumerate() @@ -501,6 +504,7 @@ impl Router { #[cfg(feature = "logger")] pub fn enable_default_logger(&mut self, enable: bool) -> &mut Self { self.default_logger = enable; + std::env::set_var("RUST_LOG", "windmark=trace"); self @@ -659,6 +663,7 @@ impl Router { /// struct Clicker { /// clicks: isize, /// } + /// /// impl windmark::Module for Clicker { /// fn on_attach(&mut self, _: &mut Router) { /// info!("clicker has been attached!"); |