Skip to content

Commit 5980c1c

Browse files
committed
examples: clippy fixes + format
1 parent 9a689c2 commit 5980c1c

File tree

10 files changed

+14
-21
lines changed

10 files changed

+14
-21
lines changed

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ js-sys = "0.3.39"
3131
pulldown-cmark = "0.7.1"
3232
rand = { version = "0.7.3", features = ["wasm-bindgen", "small_rng"] }
3333
serde = { version = "1.0.106", features = ['derive'] }
34-
serde_json = "1.0.51"
34+
serde_json = "1.0.52"
3535
wasm-bindgen = {version = "0.2.62", features = ["serde-serialize"]}
3636
wasm-bindgen-futures = "0.4.12"
3737
# @TODO: remove once we can use entities without `Debug` in `log!` and `error!` on `stable` Rust.

Diff for: examples/bunnies/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ use awsm_web::webgl::{
1919
WebGlTextureSource,
2020
};
2121
use awsm_web::window::get_window_size;
22-
use seed::web_sys::{HtmlCanvasElement, HtmlImageElement};
2322
use seed::{prelude::*, *};
2423
use shipyard::{NonSendSync, UniqueView, UniqueViewMut, World};
24+
use web_sys::{HtmlCanvasElement, HtmlImageElement};
2525

2626
mod components;
2727
mod config;

Diff for: examples/bunnies/src/scene_renderer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::geometry::*;
2+
use crate::web_sys::HtmlImageElement;
23
use nalgebra::{Matrix4, Vector3};
3-
use seed::web_sys::HtmlImageElement;
44

55
use awsm_web::webgl::{
66
AttributeOptions, BeginMode, BlendFactor, BufferData, BufferMask, BufferTarget, BufferUsage,

Diff for: examples/canvas/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ fn init(_: Url, orders: &mut impl Orders<Msg>) -> Model {
1414
Model::default()
1515
}
1616

17-
1817
// ------ ------
1918
// Model
2019
// ------ ------

Diff for: examples/custom_elements/src/code_block.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ use seed::{prelude::*, *};
77
pub fn view<Ms: 'static>(lang: &str, code: &str) -> Node<Ms> {
88
custom![
99
Tag::from("code-block"),
10-
attrs!{
10+
attrs! {
1111
At::from("lang") => lang,
1212
At::from("code") => code,
1313
}
1414
]
15-
}
15+
}

Diff for: examples/custom_elements/src/feather_icon.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use seed::{prelude::*, *};
77
pub fn view<Ms: 'static>(icon: &str, width: Option<u32>, height: Option<u32>) -> Node<Ms> {
88
custom![
99
Tag::from("feather-icon"),
10-
attrs!{
10+
attrs! {
1111
At::from("icon") => icon,
1212
At::Width => if let Some(width) = width { AtValue::Some(width.to_string()) } else { AtValue::Ignored },
1313
At::Height => if let Some(height) = height { AtValue::Some(height.to_string()) } else { AtValue::Ignored },
1414
}
1515
]
16-
}
16+
}

Diff for: examples/custom_elements/src/math_tex.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@ use seed::{prelude::*, *};
55
// ------ ------
66

77
pub fn view<Ms: 'static>(expression: &str) -> Node<Ms> {
8-
custom![
9-
Tag::from("math-tex"),
10-
expression,
11-
]
12-
}
8+
custom![Tag::from("math-tex"), expression,]
9+
}

Diff for: examples/server_integration/server/src/main.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use actix::prelude::*;
22
use actix_files::{Files, NamedFile};
33
use actix_multipart::Multipart;
44
use actix_web::{get, post, web, App, HttpServer, Result};
5+
use futures::stream::StreamExt;
56
use std::fmt::Write;
67
use std::time;
7-
use futures::stream::StreamExt;
88

99
mod count_actor;
1010
use count_actor::{CountActor, MsgIncrement};
@@ -22,11 +22,8 @@ async fn send_message(
2222
}))
2323
}
2424

25-
2625
#[get("delayed-response/{delay}")]
27-
async fn delayed_response(
28-
delay: web::Path<u64>,
29-
) -> String {
26+
async fn delayed_response(delay: web::Path<u64>) -> String {
3027
futures_timer::Delay::new(time::Duration::from_millis(*delay)).await;
3128
format!("Delay was set to {}ms.", delay)
3229
}

Diff for: examples/window_events/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
5050
} else {
5151
model.event_streams.clear();
5252
}
53-
},
53+
}
5454
Msg::MouseMoved(ev) => {
5555
model.point = Point {
5656
x: ev.client_x(),

Diff for: src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ pub mod prelude {
188188
},
189189
};
190190
pub use indexmap::IndexMap; // for attrs and style to work.
191-
pub use wasm_bindgen::{self, JsCast, prelude::*};
192-
pub use web_sys;
193191
pub use js_sys;
192+
pub use wasm_bindgen::{self, prelude::*, JsCast};
193+
pub use web_sys;
194194
}
195195

196196
#[cfg(test)]

0 commit comments

Comments
 (0)