From 33fceddc08a4239898bf0c1389aededd1a24412b Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Fri, 15 Jan 2021 23:25:07 +0900 Subject: [PATCH] Use is_empty() instead of comparing with "" --- src/routes/user.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/user.rs b/src/routes/user.rs index ec640293..7155e0fb 100644 --- a/src/routes/user.rs +++ b/src/routes/user.rs @@ -401,7 +401,7 @@ pub fn update( user.preferred_theme = form .theme .clone() - .and_then(|t| if &t == "" { None } else { Some(t) }); + .and_then(|t| if t.is_empty() { None } else { Some(t) }); user.hide_custom_css = form.hide_custom_css; let _: User = user.save_changes(&*conn).map_err(Error::from)?;