Skip to content

Commit 8ee64a1

Browse files
committed
chore: update dependencies and improve code logic in various files
1 parent 43313a3 commit 8ee64a1

7 files changed

Lines changed: 28 additions & 27 deletions

File tree

Cargo.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ cargo clippy -- -D warnings
2828
'''
2929

3030
[tasks.leptos-format]
31-
install_crate = { crate_name = "leptosfmt", version = "0.1.13" }
31+
install_crate = { crate_name = "leptosfmt", version = "0.1.33" }
3232
command = "leptosfmt"
3333
args = ["."]
3434

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ fn generate_projects(path: &Path) {
145145
}
146146
let file_path = file.path();
147147

148-
if !file_path.extension().is_some_and(|e| e == "toml") {
148+
if file_path.extension().is_none_or(|e| e != "toml") {
149149
let file_name = file.file_name();
150150
let file_name = file_name.to_str().unwrap();
151151
// Copy images or other files

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[toolchain]
22
components = ["rust-analyzer", "rustfmt", "clippy"]
3-
channel = "nightly-2024-02-12"
3+
channel = "nightly-2025-02-12"
44
profile = "minimal"
55
targets = ["wasm32-unknown-unknown"]

src/components/hero.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,22 @@ use leptos_router::use_query_map;
66
pub fn Hero() -> impl IntoView {
77
let query_params = use_query_map();
88

9-
let image_src = if query_params.get().get("uwu").is_some() && cfg!(debug_assertions) {
10-
"./assets/RustLang_Uwu.png"
11-
} else {
12-
"./assets/ferris-hero.avif"
9+
let is_in_debug_mode = cfg!(debug_assertions);
10+
let uwu = query_params.get().get("uwu").is_some();
11+
12+
let image_src = match (is_in_debug_mode, uwu) {
13+
(true, true) => "./assets/RustLang_uwu.png",
14+
(true, false) => "./assets/ferris-hero.avif",
15+
(false, false) => "./ferris-hero.avif",
16+
(false, true) => "./RustLang_uwu.png",
1317
};
1418

15-
let uwu = query_params.get().get("uwu").is_some();
1619

1720
view! {
1821
<section
1922
class=(
2023
"grid items-center py-14 lg:py-32 px-4 gap-x-20 gap-y-10 lg:grid-cols-2 w-full",
21-
move || uwu == false,
24+
move || !uwu,
2225
)
2326
class="grid items-center justify-center"
2427
>

src/components/slogan_button.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
#![allow(dead_code)]
12
use leptos::{create_signal, island, view, IntoView, SignalUpdate};
23

34
use rand::seq::SliceRandom;
45

56
#[island]
6-
pub fn SloganButton(#[prop(into)] uwu: Option<bool>) -> impl IntoView {
7+
pub fn SloganButton(uwu: bool) -> impl IntoView {
78
let slogans = [
89
"Una comunidad de gente mal intencionada y tonta.",
910
"Rust the lang, not the game",
@@ -43,7 +44,7 @@ pub fn SloganButton(#[prop(into)] uwu: Option<bool>) -> impl IntoView {
4344
<div
4445
class=(
4546
"flex select-none justify-center lg:justify-center dark:text-white drop-shadow-[7px_7px_2px_rgba(0,0,0,.5)] hover:drop-shadow-none dark:transition-all dark:ease-in-out dark:delay-75 ",
46-
move || uwu == Some(true),
47+
uwu,
4748
)
4849
class="flex select-none items-center justify-center lg:justify-start group dark:text-white drop-shadow-[7px_7px_2px_rgba(0,0,0,.5)] hover:drop-shadow-none dark:transition-all dark:ease-in-out dark:delay-75 "
4950
on:click=click_handler

src/pages/contributors.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,8 @@ pub async fn fetch_contributors() -> Vec<Contributor> {
9999
.as_array()
100100
.unwrap_or(&Vec::new())
101101
.iter()
102-
.filter_map(|repo| {
103-
(!repo["collaborators"].is_null())
104-
.then(|| repo["collaborators"]["nodes"].as_array().unwrap())
105-
})
106-
.flatten()
102+
.filter(|&repo| (!repo["collaborators"].is_null()))
103+
.flat_map(|repo| repo["collaborators"]["nodes"].as_array().unwrap())
107104
.filter_map(|c| leptos::serde_json::from_value::<Contributor>(c.clone()).ok())
108105
.fold(HashMap::new(), |prev, c| {
109106
let mut prev = prev;
@@ -159,10 +156,10 @@ pub fn Contributors() -> impl IntoView {
159156
Gracias al esfuerzo y dedicación de estos extraordinarios colaboradores open source, los servicios y páginas de nuestra comunidad se mantienen activos y en constante evolución. Su pasión por el código abierto y el desarrollo de Rust es el corazón que impulsa nuestro crecimiento.
160157
</p>
161158
<p class="md:max-w-[800px] mb-2">
162-
Te invitamos a unirte a esta vibrante comunidad, explorar nuestros repositorios en
159+
"Te invitamos a unirte a esta vibrante comunidad, explorar nuestros repositorios en "
163160
<a href="https://github.com/RustLangES" class="underline" target="_blank">
164161
GitHub
165-
</a> y contribuir con tu talento.
162+
</a> " y contribuir con tu talento."
166163
</p>
167164
<p class="md:max-w-[800px]">
168165
<strong>Juntos</strong>

0 commit comments

Comments
 (0)