Remove FromRequestParts for Config
Some checks failed
Push Workflows / rustfmt (push) Successful in 6s
Push Workflows / mdbook (push) Successful in 8s
Push Workflows / clippy (push) Failing after 34s
Push Workflows / docs (push) Successful in 42s
Push Workflows / build (push) Failing after 1m22s
Push Workflows / mdbook-server (push) Successful in 1m12s
Push Workflows / leptos-test (push) Successful in 1m30s
Push Workflows / test (push) Successful in 1m44s
Push Workflows / docker-build (push) Successful in 4m20s
Push Workflows / nix-build (push) Successful in 12m53s
Some checks failed
Push Workflows / rustfmt (push) Successful in 6s
Push Workflows / mdbook (push) Successful in 8s
Push Workflows / clippy (push) Failing after 34s
Push Workflows / docs (push) Successful in 42s
Push Workflows / build (push) Failing after 1m22s
Push Workflows / mdbook-server (push) Successful in 1m12s
Push Workflows / leptos-test (push) Successful in 1m30s
Push Workflows / test (push) Successful in 1m44s
Push Workflows / docker-build (push) Successful in 4m20s
Push Workflows / nix-build (push) Successful in 12m53s
This commit is contained in:
@ -99,19 +99,3 @@ impl Config {
|
|||||||
pub fn load_config() -> Result<Config, clap::error::Error> {
|
pub fn load_config() -> Result<Config, clap::error::Error> {
|
||||||
Config::try_parse()
|
Config::try_parse()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow Config to be extracted in a request handler
|
|
||||||
impl<S> FromRequestParts<S> for Config
|
|
||||||
where
|
|
||||||
S: Send + Sync,
|
|
||||||
{
|
|
||||||
type Rejection = (StatusCode, &'static str);
|
|
||||||
|
|
||||||
async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result<Self, Self::Rejection> {
|
|
||||||
parts
|
|
||||||
.extensions
|
|
||||||
.get::<Config>()
|
|
||||||
.cloned()
|
|
||||||
.ok_or((StatusCode::INTERNAL_SERVER_ERROR, "Configuration not found"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user