Clippy lints

This commit is contained in:
Aode (lion) 2021-09-12 11:27:22 -05:00
parent 1f2b5ead19
commit 32ebc3fc50
8 changed files with 11 additions and 12 deletions

View file

@ -139,7 +139,7 @@ impl Config {
}
}
static CONFIG: Lazy<Config> = Lazy::new(|| Config::from_args());
static CONFIG: Lazy<Config> = Lazy::new(Config::from_args);
#[derive(serde::Deserialize)]
enum FileType {

View file

@ -5,7 +5,7 @@
@:layout_html("Confirm Delete", Some(&format!("Delete {} from pict-rs", image.filename())), {
<title>Confirm Delete</title>
<link rel="stylesheet" href="@crate::statics(&images_css.name)" type="text/css" />
<link rel="stylesheet" href="@crate::statics(images_css.name)" type="text/css" />
}, {
<section>
<article>

View file

@ -4,7 +4,7 @@
@(images: Images)
@:layout_html(images.message(), None, {
<link rel="stylesheet" href="@crate::statics(&images_css.name)" type="text/css" />
<link rel="stylesheet" href="@crate::statics(images_css.name)" type="text/css" />
}, {
<section>
@if let Some(images) = images.files() {

View file

@ -3,8 +3,8 @@
@(endpoint: &str, name: &str)
@:layout_html("Upload Images", None, {
<link rel="stylesheet" href="@crate::statics(&form_css.name)" type="text/css" />
<script src="@crate::statics(&form_js.name)" type="text/javascript"></script>
<link rel="stylesheet" href="@crate::statics(form_css.name)" type="text/css" />
<script src="@crate::statics(form_js.name)" type="text/javascript"></script>
}, {
<section>
<form method="post" action="@endpoint" enctype="multipart/form-data">

View file

@ -9,7 +9,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>@title</title>
<link rel="stylesheet" href="@crate::statics(&layout_css.name)" type="text/css" />
<link rel="stylesheet" href="@crate::statics(layout_css.name)" type="text/css" />
<meta property="og:title" content="@title" />
@if let Some(description) = description {
<meta property="og:description" content="@description" />
@ -17,7 +17,7 @@
<meta property="og:description" content="Upload and share image files" />
}
<meta property="og:type" content="website" />
<link rel="shortcut icon" type="image/png" href="@crate::statics(&favicon_ico.name)">
<link rel="shortcut icon" type="image/png" href="@crate::statics(favicon_ico.name)">
@:head()
</head>
<body>

View file

@ -3,7 +3,7 @@
@()
@:layout_html("Not Found", None, {
<link rel="stylesheet" href="@crate::statics(&not_found_css.name)" type="text/css" />
<link rel="stylesheet" href="@crate::statics(not_found_css.name)" type="text/css" />
}, {
<section>
<article>

View file

@ -7,7 +7,7 @@
<meta property="og:image" content="@image.link()" />
<meta property="og:url" content="@image.link()" />
<meta property="og:image:alt" content="Image: @image.filename()" />
<link rel="stylesheet" href="@crate::statics(&images_css.name)" type="text/css" />
<link rel="stylesheet" href="@crate::statics(images_css.name)" type="text/css" />
}, {
<section>
<article>

View file

@ -4,7 +4,7 @@
@(image: Image, size: Option<u64>)
@:layout_html(&format!("Image: {}", image.filename()), Some("An image hosted on pict-rs"), {
<link rel="stylesheet" href="@crate::statics(&images_css.name)" type="text/css" />
<link rel="stylesheet" href="@crate::statics(images_css.name)" type="text/css" />
@if let Some(size) = size {
<meta property="og:image" content="@image.thumb(size, FileType::Jpg)" />
<meta property="og:url" content="@image.view(Some(size))" />
@ -36,11 +36,10 @@
loop
>
</video>
<p><a href="@image.link()">Direct Link</a></p>
} else {
<img src="@image.link()" alt="@image.filename()" title="@image.filename()" />
<p><a href="@image.link()">Direct Link</a></p>
}
<p><a href="@image.link()">Direct Link</a></p>
}
</div>
</article>