mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-04 23:44:13 +00:00
apply clippy corrections
This commit is contained in:
parent
4cd0451aed
commit
f2e4d57d69
@ -79,7 +79,7 @@ impl Request {
|
||||
referrer: _,
|
||||
uri,
|
||||
}
|
||||
| Self::Titan(uri) => &uri,
|
||||
| Self::Titan(uri) => uri,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,9 @@ const DOWNLOAD: &str = "download:";
|
||||
const SOURCE: &str = "source:";
|
||||
|
||||
/// Feature wrapper for client `Request`
|
||||
#[derive(Default)]
|
||||
pub enum Feature {
|
||||
#[default]
|
||||
Default,
|
||||
Download,
|
||||
Source,
|
||||
@ -37,9 +39,3 @@ impl Feature {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Feature {
|
||||
fn default() -> Self {
|
||||
Feature::Default
|
||||
}
|
||||
}
|
||||
|
@ -89,10 +89,7 @@ fn handle(
|
||||
Ok(text) => callback(Response::TextGemini {
|
||||
base,
|
||||
source: text.data,
|
||||
is_source_request: match feature {
|
||||
Feature::Source => true,
|
||||
_ => false,
|
||||
},
|
||||
is_source_request: matches!(feature, Feature::Source),
|
||||
}),
|
||||
Err(e) => callback(Response::Failure(Failure::Mime {
|
||||
base,
|
||||
@ -177,7 +174,7 @@ fn redirect(
|
||||
// [Gemini protocol specifications](https://geminiprotocol.net/docs/protocol-specification.gmi#redirection)
|
||||
if referrer.len() > 5 {
|
||||
return Response::Failure(Failure::Error {
|
||||
message: format!("Max redirection count reached"),
|
||||
message: "Max redirection count reached".to_string(),
|
||||
});
|
||||
}
|
||||
match data {
|
||||
@ -190,9 +187,8 @@ fn redirect(
|
||||
|| base.host() != target.host()
|
||||
{
|
||||
return Response::Failure(Failure::Error {
|
||||
message: format!(
|
||||
"External redirects not allowed by protocol specification"
|
||||
),
|
||||
message: "External redirects not allowed by protocol specification"
|
||||
.to_string(),
|
||||
}); // @TODO placeholder page with optional link open button
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user