diff options
| author | Fuwn <[email protected]> | 2023-04-10 07:23:29 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-04-10 07:23:29 +0000 |
| commit | 9934455d4c1857b22a6f54105e54d241f5f61871 (patch) | |
| tree | c0e4165c7ea43200fbeae6d472dc036c58b1079e /src/router.rs | |
| parent | fix(macros): restrict macro name (diff) | |
| download | windmark-9934455d4c1857b22a6f54105e54d241f5f61871.tar.xz windmark-9934455d4c1857b22a6f54105e54d241f5f61871.zip | |
refactor(partial): into trait
Diffstat (limited to 'src/router.rs')
| -rw-r--r-- | src/router.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/router.rs b/src/router.rs index f5f6725..2f92088 100644 --- a/src/router.rs +++ b/src/router.rs @@ -78,8 +78,8 @@ pub struct Router { error_handler: Arc<AsyncMutex<Box<dyn ErrorResponse>>>, private_key_file_name: String, ca_file_name: String, - headers: Arc<Mutex<Vec<Box<dyn Partial<Output = String>>>>>, - footers: Arc<Mutex<Vec<Box<dyn Partial<Output = String>>>>>, + headers: Arc<Mutex<Vec<Box<dyn Partial>>>>, + footers: Arc<Mutex<Vec<Box<dyn Partial>>>>, ssl_acceptor: Arc<SslAcceptor>, #[cfg(feature = "logger")] default_logger: bool, @@ -380,8 +380,10 @@ impl Router { ); for partial_header in &mut *self.headers.lock().unwrap() { - header - .push_str(&format!("{}\n", partial_header(route_context.clone()),)); + header.push_str(&format!( + "{}\n", + partial_header.call(route_context.clone()), + )); } for (i, partial_footer) in { @@ -390,7 +392,7 @@ impl Router { } { footer.push_str(&format!( "{}{}", - partial_footer(route_context.clone()), + partial_footer.call(route_context.clone()), if footers_length > 1 && i != footers_length - 1 { "\n" } else { |