🚨 Fix clippy warnings

This commit is contained in:
2024-05-10 20:09:19 +02:00
parent c2918fbc78
commit 692a71faef
4 changed files with 21 additions and 23 deletions

View File

@@ -116,7 +116,7 @@ async fn fetch_text(req: String) -> RequestResult<String> {
async fn fetch_dicebear_svg( async fn fetch_dicebear_svg(
r#type: &DicebearType, r#type: &DicebearType,
req_fields: &Vec<String>, req_fields: &[String],
placeholder_fetcher: Option<Box<impl Future<Output = Option<String>>>>, placeholder_fetcher: Option<Box<impl Future<Output = Option<String>>>>,
) -> String { ) -> String {
// TODO: Use configuration file // TODO: Use configuration file
@@ -146,7 +146,7 @@ async fn fetch_dicebear_svg(
} }
#[cfg(feature = "desktop")] #[cfg(feature = "desktop")]
fn gen_placeholder_fetcher<'a>(path: &'static str) -> Box<impl Future<Output = Option<String>>> { fn gen_placeholder_fetcher(path: &'static str) -> Box<impl Future<Output = Option<String>>> {
let path = format!("./public/{}", &path); let path = format!("./public/{}", &path);
Box::new(async move { Box::new(async move {
match read_to_string(&path).await { match read_to_string(&path).await {

View File

@@ -3,7 +3,6 @@ use dioxus::prelude::*;
use dioxus_free_icons::icons::fa_solid_icons::{ use dioxus_free_icons::icons::fa_solid_icons::{
FaComments, FaLayerGroup, FaMagnifyingGlass, FaPeopleGroup, FaComments, FaLayerGroup, FaMagnifyingGlass, FaPeopleGroup,
}; };
use dioxus_free_icons::icons::md_navigation_icons::MdArrowDropDown;
use dioxus_free_icons::{Icon, IconShape}; use dioxus_free_icons::{Icon, IconShape};
turf::style_sheet!("src/ui/components/icons.scss"); turf::style_sheet!("src/ui/components/icons.scss");
@@ -26,9 +25,6 @@ macro_rules! transparent_icon {
}; };
} }
// TODO: Remove this icon once the conversation panel finished
transparent_icon!(DownArrowIcon, MdArrowDropDown);
transparent_icon!(SearchIcon, FaMagnifyingGlass); transparent_icon!(SearchIcon, FaMagnifyingGlass);
transparent_icon!(SpacesIcon, FaLayerGroup); transparent_icon!(SpacesIcon, FaLayerGroup);
transparent_icon!(ChatsIcon, FaComments); transparent_icon!(ChatsIcon, FaComments);

View File

@@ -538,7 +538,7 @@ fn generate_modal(
on_confirm: on_confirm, on_confirm: on_confirm,
div { div {
{rendered_suggestions.into_iter()} {rendered_suggestions.iter()}
} }
} }
} }
@@ -608,15 +608,16 @@ pub fn Login() -> Element {
generate_random_svg_shape(Some(&shape_config)).await generate_random_svg_shape(Some(&shape_config)).await
}); });
let avatar = match &*random_avatar_future.read_unchecked() { let avatar = (*random_avatar_future.read_unchecked())
Some(svg) => Some(rsx! { .as_ref()
.map(|svg| {
rsx! {
div { div {
class: ClassName::LOGIN_AVATAR_CONTENT, class: ClassName::LOGIN_AVATAR_CONTENT,
dangerous_inner_html: svg.as_str(), dangerous_inner_html: svg.as_str(),
} }
}), }
None => None, });
};
if *spinner_animated.read() && SESSION.read().is_logged { if *spinner_animated.read() && SESSION.read().is_logged {
debug!("Stop spinner"); debug!("Stop spinner");

View File

@@ -59,15 +59,16 @@ pub fn Modal(props: ModalProps) -> Element {
let random_figure_future = let random_figure_future =
use_resource(move || async move { generate_random_svg_avatar(avatar_config).await }); use_resource(move || async move { generate_random_svg_avatar(avatar_config).await });
let icon = match &*random_figure_future.read_unchecked() { let icon = (*random_figure_future.read_unchecked())
Some(svg) => Some(rsx! { .as_ref()
.map(|svg| {
rsx! {
div { div {
class: ClassName::MODAL_CONTENT_ICON_PLACEHOLDER, class: ClassName::MODAL_CONTENT_ICON_PLACEHOLDER,
dangerous_inner_html: svg.as_str(), dangerous_inner_html: svg.as_str(),
} }
}), }
None => None, });
};
let button_class = match &props.severity { let button_class = match &props.severity {
Severity::Ok => SuccessButton, Severity::Ok => SuccessButton,