diff options
| author | Fuwn <[email protected]> | 2023-04-06 08:34:24 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-04-06 08:34:24 +0000 |
| commit | 873cef6fbba01c99733c97378b5f001779604cf4 (patch) | |
| tree | 4dc531b2005740ec5048350ecdae7ba15836e058 /src/context/route.rs | |
| parent | feat(cargo): bump 0.3.1 -> 0.3.2 (diff) | |
| download | windmark-873cef6fbba01c99733c97378b5f001779604cf4.tar.xz windmark-873cef6fbba01c99733c97378b5f001779604cf4.zip | |
fix(context): custom parameters format for easy lifetimes
Diffstat (limited to 'src/context/route.rs')
| -rw-r--r-- | src/context/route.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/context/route.rs b/src/context/route.rs index 9ff0b03..a39ad0b 100644 --- a/src/context/route.rs +++ b/src/context/route.rs @@ -16,31 +16,33 @@ // Copyright (C) 2022-2022 Fuwn <[email protected]> // SPDX-License-Identifier: GPL-3.0-only +use std::collections::HashMap; + use matchit::Params; use openssl::x509::X509; use url::Url; #[allow(clippy::module_name_repetitions)] #[derive(Clone)] -pub struct RouteContext<'a> { +pub struct RouteContext { pub peer_address: Option<std::net::SocketAddr>, pub url: Url, - pub params: Params<'a, 'a>, + pub params: HashMap<String, String>, pub certificate: Option<X509>, } -impl<'a> RouteContext<'a> { +impl RouteContext { #[must_use] pub fn new( peer_address: std::io::Result<std::net::SocketAddr>, url: Url, - params: Params<'a, 'a>, + params: &Params<'_, '_>, certificate: Option<X509>, ) -> Self { Self { peer_address: peer_address.ok(), url, - params, + params: crate::utilities::params_to_hashmap(params), certificate, } } |