fix: clippy warnings, add missing wry feature on examples (#1604)

* fix: clippy warnings, add missing wry feature on examples

* schema feat does not exist

* also add compression
This commit is contained in:
Lucas Fernandes Nogueira
2024-07-31 07:14:05 -03:00
committed by GitHub
parent e847cedc1f
commit 95da90f82e
10 changed files with 37 additions and 20 deletions
+9 -10
View File
@@ -121,18 +121,17 @@ impl<'de> Deserialize<'de> for UpdaterEndpoint {
D: Deserializer<'de>,
{
let url = Url::deserialize(deserializer)?;
#[cfg(not(feature = "schema"))]
{
if url.scheme() != "https" {
#[cfg(debug_assertions)]
eprintln!("[\x1b[33mWARNING\x1b[0m] The configured updater endpoint doesn't use `https` protocol. This is allowed in development but will fail in release builds.");
#[cfg(not(debug_assertions))]
return Err(serde::de::Error::custom(
"The configured updater endpoint must use the `https` protocol.",
));
}
if url.scheme() != "https" {
#[cfg(debug_assertions)]
eprintln!("[\x1b[33mWARNING\x1b[0m] The configured updater endpoint doesn't use `https` protocol. This is allowed in development but will fail in release builds.");
#[cfg(not(debug_assertions))]
return Err(serde::de::Error::custom(
"The configured updater endpoint must use the `https` protocol.",
));
}
Ok(Self(url))
}
}