mirror of
https://github.com/redlib-org/redlib.git
synced 2025-06-08 07:37:45 +00:00
Fix clippy warnings
This commit is contained in:
parent
b0f985c687
commit
c5d11f220e
5 changed files with 24 additions and 35 deletions
|
@ -325,14 +325,13 @@ async fn main() {
|
|||
// Instance info page
|
||||
app.at("/info").get(|r| instance_info::instance_info(r).boxed());
|
||||
app.at("/info.:extension").get(|r| instance_info::instance_info(r).boxed());
|
||||
|
||||
// Handle obfuscated share links.
|
||||
|
||||
// Handle obfuscated share links.
|
||||
// Note that this still forces the server to follow the share link to get to the post, so maybe this wants to be updated with a warning before it follow it
|
||||
app.at("/r/:sub/s/:id").get(|req: Request<Body>| {
|
||||
Box::pin(async move {
|
||||
let sub = req.param("sub").unwrap_or_default();
|
||||
match req.param("id").as_deref() {
|
||||
|
||||
// Share link
|
||||
Some(id) if (8..12).contains(&id.len()) => match canonical_path(format!("/r/{}/s/{}", sub, id)).await {
|
||||
Ok(Some(path)) => Ok(redirect(path.split('?').next().unwrap_or_default().to_string())),
|
||||
|
@ -345,7 +344,7 @@ async fn main() {
|
|||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
app.at("/:id").get(|req: Request<Body>| {
|
||||
Box::pin(async move {
|
||||
match req.param("id").as_deref() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue