We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86bc65c commit 46f2221Copy full SHA for 46f2221
frameworks/keyed/leptos/src/lib.rs
@@ -50,16 +50,12 @@ static ID_COUNTER: AtomicUsize = AtomicUsize::new(1);
50
fn build_data(count: usize) -> Vec<RowData> {
51
let mut thread_rng = thread_rng();
52
53
- let mut choose =
54
- |slice: &[&'static str]| slice.choose(&mut thread_rng).unwrap();
55
-
56
(0..count)
57
.map(|_| RowData {
58
id: ID_COUNTER.fetch_add(1, Ordering::Relaxed),
59
- label: ArcRwSignal::new(format!("{} {} {}",
60
- choose(ADJECTIVES),
61
- choose(COLOURS),
62
- choose(NOUNS))),
+ label: ArcRwSignal::new([ADJECTIVES, COLOURS, NOUNS]
+ .map(|slice| slice.choose(&mut thread_rng).unwrap())
+ .join(" "))
63
})
64
.collect()
65
}
0 commit comments