Skip to content

Commit

Permalink
🎨 Fix clippy.
Browse files Browse the repository at this point in the history
  • Loading branch information
langyo committed Dec 21, 2023
1 parent 06c9fdd commit f5e06dc
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 32 deletions.
7 changes: 2 additions & 5 deletions examples/app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ use tauri::Manager;
fn my_custom_command(window: tauri::Window, app_handle: tauri::AppHandle) -> String {
println!("{}", window.label());
let app_path = app_handle.path_resolver().app_data_dir();
match app_path {
Some(dir) => {
println!("{}", dir.display())
}
None => {}
if let Some(dir) = app_path {
println!("{}", dir.display())
};
window.set_always_on_top(true).unwrap();
// window
Expand Down
2 changes: 1 addition & 1 deletion examples/web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ anyhow = "^1"
async-trait = "^0.1"
base64 = "^0.21"
derive_more = "*"
gloo = "^0.11"
serde = { version = "^1", features = ["derive"] }
serde_json = "^1"
strum = "^0.25"
strum_macros = "^0.25"

console_log = "^1"
gloo = "^0.11"
js-sys = "^0.3"
log = "^0.4"
wasm-bindgen = "0.2.87"
Expand Down
4 changes: 2 additions & 2 deletions examples/web/src/pages/portal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ pub fn Portal() -> Html {
let data = data.to_owned();

wasm_bindgen_futures::spawn_local(async move {
match Request::get(&*uri).send().await {
match Request::get(&uri).send().await {
Ok(response) => {
let raw = (&response).text().await.unwrap();
let raw = response.text().await.unwrap();
info!("{:?}", response);
data.set(raw);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/components-container/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ hikari-theme = { path = "../theme" }
anyhow = "^1"
base64 = "^0.21"
derive_more = "*"
gloo = "^0.11"
serde = { version = "^1", features = ["derive"] }
serde_json = "^1"
strum = "^0.25"
strum_macros = "^0.25"

console_log = "^1"
gloo = "^0.11"
js-sys = "^0.3"
log = "^0.4"
wasm-bindgen = "0.2.87"
Expand Down
29 changes: 15 additions & 14 deletions packages/components-container/src/components/container_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ use super::{AsideLayout, FooterLayout, HeaderLayout, MainLayout};

#[derive(Clone, PartialEq)]
pub enum ContainerLayoutVariant {
AsideLayout(VChild<AsideLayout>),
FooterLayout(VChild<FooterLayout>),
HeaderLayout(VChild<HeaderLayout>),
MainLayout(VChild<MainLayout>),
ContainerLayout(VChild<ContainerLayout>),
Aside(VChild<AsideLayout>),
Footer(VChild<FooterLayout>),
Header(VChild<HeaderLayout>),
Main(VChild<MainLayout>),
Container(VChild<ContainerLayout>),
}

#[allow(clippy::from_over_into)]
impl Into<Html> for ContainerLayoutVariant {
fn into(self) -> Html {
match self {
Self::AsideLayout(child) => child.into(),
Self::FooterLayout(child) => child.into(),
Self::HeaderLayout(child) => child.into(),
Self::MainLayout(child) => child.into(),
Self::ContainerLayout(child) => child.into(),
Self::Aside(child) => child.into(),
Self::Footer(child) => child.into(),
Self::Header(child) => child.into(),
Self::Main(child) => child.into(),
Self::Container(child) => child.into(),
}
}
}
Expand All @@ -33,10 +33,11 @@ pub struct ContainerLayoutProps {

#[styled_component]
pub fn ContainerLayout(props: &ContainerLayoutProps) -> Html {
let is_vertical = if props.children.iter().any(|child| match child {
ContainerLayoutVariant::HeaderLayout(_) => true,
ContainerLayoutVariant::FooterLayout(_) => true,
_ => false,
let is_vertical = if props.children.iter().any(|child| {
matches!(
child,
ContainerLayoutVariant::Header(_) | ContainerLayoutVariant::Footer(_)
)
}) {
Some(css!("flex-direction: column;"))
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/components-form/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ hikari-theme = { path = "../theme" }
anyhow = "^1"
base64 = "^0.21"
derive_more = "*"
gloo = "^0.11"
serde = { version = "^1", features = ["derive"] }
serde_json = "^1"
strum = "^0.25"
strum_macros = "^0.25"

console_log = "^1"
gloo = "^0.11"
js-sys = "^0.3"
log = "^0.4"
wasm-bindgen = "0.2.87"
Expand Down
8 changes: 4 additions & 4 deletions packages/components-form/src/components/button_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ pub enum ButtonGroupVariant {
Button(VChild<Button>),
}

impl Into<Html> for ButtonGroupVariant {
fn into(self) -> Html {
match self {
Self::Button(child) => child.into(),
impl From<ButtonGroupVariant> for Html {
fn from(val: ButtonGroupVariant) -> Self {
match val {
ButtonGroupVariant::Button(child) => child.into(),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/macro-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ anyhow = "^1"
async-trait = "^0.1"
base64 = "^0.21"
derive_more = "*"
gloo = "^0.11"
serde = { version = "^1", features = ["derive"] }
serde_json = "^1"
strum = "^0.25"
strum_macros = "^0.25"

console_log = "^1"
gloo = "^0.11"
js-sys = "^0.3"
log = "^0.4"
wasm-bindgen = "0.2.87"
Expand Down
8 changes: 5 additions & 3 deletions packages/macro/src/utils/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const COMPONENT_ATTR_IDENT: &str = "component";

pub struct DeriveRoutes {
ident: Ident,
components: HashMap<Ident, (Vec<(Ident, Type)>, Path)>,
components: Components,
}

impl Parse for DeriveRoutes {
Expand Down Expand Up @@ -40,10 +40,12 @@ impl Parse for DeriveRoutes {
}
}

type Components = HashMap<Ident, (Vec<(Ident, Type)>, Path)>;

fn parse_variants_attributes(
variants: &Punctuated<Variant, syn::token::Comma>,
) -> syn::Result<HashMap<Ident, (Vec<(Ident, Type)>, Path)>> {
let mut components: HashMap<Ident, (Vec<(Ident, Type)>, Path)> = Default::default();
) -> syn::Result<Components> {
let mut components: Components = Default::default();

for variant in variants.iter() {
if let Fields::Unnamed(ref field) = variant.fields {
Expand Down

0 comments on commit f5e06dc

Please sign in to comment.