refactor: clippy
This commit is contained in:
parent
d4b635a462
commit
ad0c287729
2 changed files with 4 additions and 8 deletions
|
@ -10,7 +10,7 @@ use crate::components::{Group, Home, TestMessage, ToastFields, ToastType};
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct ListGroups {
|
pub struct ListGroups {
|
||||||
idUser: String,
|
id_user: String,
|
||||||
groups: Vec<Group>,
|
groups: Vec<Group>,
|
||||||
free_groups: Vec<Group>,
|
free_groups: Vec<Group>,
|
||||||
nb_show: usize,
|
nb_show: usize,
|
||||||
|
@ -78,14 +78,14 @@ impl Component for ListGroups {
|
||||||
|
|
||||||
fn create(ctx: &Context<Self>) -> Self {
|
fn create(ctx: &Context<Self>) -> Self {
|
||||||
Self {
|
Self {
|
||||||
idUser: ctx.props().id.clone(),
|
id_user: ctx.props().id.clone(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn view(&self, ctx: &Context<Self>) -> Html {
|
fn view(&self, ctx: &Context<Self>) -> Html {
|
||||||
if self.groups.len() == 0 {
|
if self.groups.len() == 0 {
|
||||||
let id = self.idUser.clone();
|
let id = self.id_user.clone();
|
||||||
ctx.link().send_future(async move {
|
ctx.link().send_future(async move {
|
||||||
match Request::get(&format!("/api/users/{}/groups", id))
|
match Request::get(&format!("/api/users/{}/groups", id))
|
||||||
.send()
|
.send()
|
||||||
|
@ -115,7 +115,7 @@ impl Component for ListGroups {
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.free_groups.len() == 0 {
|
if self.free_groups.len() == 0 {
|
||||||
let id = self.idUser.clone();
|
let id = self.id_user.clone();
|
||||||
ctx.link().send_future(async move {
|
ctx.link().send_future(async move {
|
||||||
match Request::get(&format!("/api/users/{}/not/groups", id))
|
match Request::get(&format!("/api/users/{}/not/groups", id))
|
||||||
.send()
|
.send()
|
||||||
|
|
|
@ -3,7 +3,6 @@ mod components;
|
||||||
use components::Home;
|
use components::Home;
|
||||||
|
|
||||||
use gloo_net::http::Request;
|
use gloo_net::http::Request;
|
||||||
use gloo_storage::{LocalStorage, Storage};
|
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
use yew_router::prelude::*;
|
use yew_router::prelude::*;
|
||||||
|
|
||||||
|
@ -21,12 +20,9 @@ enum Route {
|
||||||
|
|
||||||
#[function_component(About)]
|
#[function_component(About)]
|
||||||
fn about() -> Html {
|
fn about() -> Html {
|
||||||
let _history = use_history().unwrap();
|
|
||||||
let test: String = LocalStorage::get("test").unwrap_or(String::from("nop"));
|
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<h1>{ "À propos" }</h1>
|
<h1>{ "À propos" }</h1>
|
||||||
<p>{ test }</p>
|
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue