Remove underscore prefix from route methods to suppress clippy

This commit is contained in:
Kitaiti Makoto 2021-01-15 23:58:48 +09:00
parent 33fceddc08
commit f720dcbe9a
6 changed files with 13 additions and 11 deletions

View File

@ -246,8 +246,9 @@ pub fn theme_files(file: PathBuf, _build_id: &RawStr) -> Option<ThemeFile> {
.map(ThemeFile) .map(ThemeFile)
} }
#[get("/static/cached/<_build_id>/<file..>", rank = 2)] #[allow(unused_variables)]
pub fn plume_static_files(file: PathBuf, _build_id: &RawStr) -> Option<CachedFile> { #[get("/static/cached/<build_id>/<file..>", rank = 2)]
pub fn plume_static_files(file: PathBuf, build_id: &RawStr) -> Option<CachedFile> {
static_files(file) static_files(file)
} }
#[get("/static/media/<file..>")] #[get("/static/media/<file..>")]

View File

@ -378,9 +378,10 @@ pub struct UpdateUserForm {
pub hide_custom_css: bool, pub hide_custom_css: bool,
} }
#[put("/@/<_name>/edit", data = "<form>")] #[allow(unused_variables)]
#[put("/@/<name>/edit", data = "<form>")]
pub fn update( pub fn update(
_name: String, name: String,
conn: DbConn, conn: DbConn,
mut user: User, mut user: User,
form: LenientForm<UpdateUserForm>, form: LenientForm<UpdateUserForm>,

View File

@ -12,9 +12,9 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>@title ⋅ @i18n!(ctx.1, "Plume")</title> <title>@title ⋅ @i18n!(ctx.1, "Plume")</title>
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="@uri!(plume_static_files: file = Path::new("css").join(ctx.2.clone().and_then(|u| u.preferred_theme).unwrap_or_else(|| CONFIG.default_theme.clone())).join("theme.css"), _build_id = CACHE_NAME)" /> <link rel="stylesheet" href="@uri!(plume_static_files: file = Path::new("css").join(ctx.2.clone().and_then(|u| u.preferred_theme).unwrap_or_else(|| CONFIG.default_theme.clone())).join("theme.css"), build_id = CACHE_NAME)" />
<link rel="manifest" href="@uri!(instance::web_manifest)" /> <link rel="manifest" href="@uri!(instance::web_manifest)" />
<link rel="icon" type="image/png" href="@uri!(plume_static_files: file = CONFIG.logo.favicon.as_str(), _build_id = CACHE_NAME)"> <link rel="icon" type="image/png" href="@uri!(plume_static_files: file = CONFIG.logo.favicon.as_str(), build_id = CACHE_NAME)">
<meta content='#282c37' name='theme-color'/> <meta content='#282c37' name='theme-color'/>
@:head() @:head()
</head> </head>
@ -26,7 +26,7 @@
<div id="content"> <div id="content">
<nav> <nav>
<a href="@uri!(instance::index)" class="title"> <a href="@uri!(instance::index)" class="title">
<img src="@uri!(plume_static_files: file = CONFIG.logo.main.as_str(), _build_id = CACHE_NAME)"> <img src="@uri!(plume_static_files: file = CONFIG.logo.main.as_str(), build_id = CACHE_NAME)">
<p>@i18n!(ctx.1, "Plume")</p> <p>@i18n!(ctx.1, "Plume")</p>
</a> </a>
<hr/> <hr/>
@ -96,6 +96,6 @@
<a href="https://matrix.to/#/#plume-blog:matrix.org">@i18n!(ctx.1, "Matrix room")</a> <a href="https://matrix.to/#/#plume-blog:matrix.org">@i18n!(ctx.1, "Matrix room")</a>
</div> </div>
</footer> </footer>
<script src="@uri!(plume_static_files: file = "plume-front.js", _build_id = CACHE_NAME)"></script> <script src="@uri!(plume_static_files: file = "plume-front.js", build_id = CACHE_NAME)"></script>
</body> </body>
</html> </html>

View File

@ -27,7 +27,7 @@
<link href='@blog.ap_url' rel='canonical'> <link href='@blog.ap_url' rel='canonical'>
@if !ctx.2.clone().map(|u| u.hide_custom_css).unwrap_or(false) { @if !ctx.2.clone().map(|u| u.hide_custom_css).unwrap_or(false) {
@if let Some(ref theme) = blog.theme { @if let Some(ref theme) = blog.theme {
<link rel="stylesheet" href="@uri!(plume_static_files: file = Path::new("css").join(theme).join("theme.css"), _build_id = CACHE_NAME)"> <link rel="stylesheet" href="@uri!(plume_static_files: file = Path::new("css").join(theme).join("theme.css"), build_id = CACHE_NAME)">
} }
} }
}, { }, {

View File

@ -24,7 +24,7 @@
@if !ctx.2.clone().map(|u| u.hide_custom_css).unwrap_or(false) { @if !ctx.2.clone().map(|u| u.hide_custom_css).unwrap_or(false) {
@if let Some(ref theme) = blog.theme { @if let Some(ref theme) = blog.theme {
<link rel="stylesheet" href="@uri!(plume_static_files: file = Path::new("css").join(theme).join("theme.css"), _build_id = CACHE_NAME)"> <link rel="stylesheet" href="@uri!(plume_static_files: file = Path::new("css").join(theme).join("theme.css"), build_id = CACHE_NAME)">
} }
} }
}, { }, {

View File

@ -14,7 +14,7 @@
@i18n!(ctx.1, "To change your avatar, upload it to your gallery and then select from there.") @i18n!(ctx.1, "To change your avatar, upload it to your gallery and then select from there.")
<a href="@uri!(medias::new)">@i18n!(ctx.1, "Upload an avatar")</a> <a href="@uri!(medias::new)">@i18n!(ctx.1, "Upload an avatar")</a>
</p> </p>
<form method="post" action="@uri!(user::update: _name = u.username.clone())"> <form method="post" action="@uri!(user::update: name = u.username.clone())">
<!-- Rocket hack to use various HTTP methods --> <!-- Rocket hack to use various HTTP methods -->
<input type=hidden name="_method" value="put"> <input type=hidden name="_method" value="put">