Skip to content

Commit 550b97a

Browse files
committed
resolve clippy problems, disable bunnies
1 parent 45afb07 commit 550b97a

File tree

17 files changed

+32
-22
lines changed

17 files changed

+32
-22
lines changed

examples/auth/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl Page {
6262
match url.next_path_part() {
6363
None => {
6464
if let Some(user) = user {
65-
send_request_to_top_secret(user.token.clone(), orders)
65+
send_request_to_top_secret(user.token.clone(), orders);
6666
};
6767
Self::Home
6868
}

examples/bunnies/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ edition = "2018"
66

77
[lib]
88
crate-type = ["cdylib"]
9+
# https://github.com/leudz/shipyard/issues/129
10+
path = "src/empty_lib.rs"
911

1012
[dependencies]
1113
seed = {path = "../../"}

examples/bunnies/src/empty_lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

examples/component_builder/src/button.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ impl<Ms> Default for Button<Ms> {
244244
// E.g. `div![Button::new("My button")]`
245245
impl<Ms> UpdateEl<Ms> for Button<Ms> {
246246
fn update_el(self, el: &mut El<Ms>) {
247-
self.view().update_el(el)
247+
self.view().update_el(el);
248248
}
249249
}
250250

examples/custom_elements/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn update(msg: Msg, model: &mut Model, _: &mut impl Orders<Msg>) {
3838
match msg {
3939
Msg::RotateCheckboxState(name) => {
4040
if name == "checkbox-tristate" {
41-
model.checkbox_state = model.checkbox_state.next()
41+
model.checkbox_state = model.checkbox_state.next();
4242
}
4343
}
4444
Msg::InputChanged(value) => {

examples/server_integration/client/src/example_d.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
7070
if let Some(controller) = &model.request_controller {
7171
controller.disable_timeout().expect("disable timeout");
7272
}
73-
model.status = Status::WaitingForResponse(TimeoutStatus::Disabled)
73+
model.status = Status::WaitingForResponse(TimeoutStatus::Disabled);
7474
}
7575

7676
Msg::Fetched(fetch_result) => {

examples/server_integration/client/src/example_e.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ fn clear_file_input() {
130130
.and_then(|element| element.dyn_into::<web_sys::HtmlInputElement>().ok())
131131
.map(|file_input| {
132132
// Note: `file_input.set_files(None)` doesn't work
133-
file_input.set_value("")
133+
file_input.set_value("");
134134
});
135135
}
136136

137137
fn toggle(value: &mut bool) {
138-
*value = !*value
138+
*value = !*value;
139139
}
140140

141141
// ------ ------

examples/server_integration/server/src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async fn form(mut form: Multipart) -> String {
4444
let mut field_bytes: Vec<u8> = Vec::new();
4545
while let Some(Ok(bytes)) = field.next().await {
4646
for byte in bytes {
47-
field_bytes.push(byte)
47+
field_bytes.push(byte);
4848
}
4949
}
5050

@@ -60,6 +60,7 @@ async fn form(mut form: Multipart) -> String {
6060
output
6161
}
6262

63+
#[allow(clippy::unused_async)]
6364
async fn index() -> Result<NamedFile> {
6465
Ok(NamedFile::open("./client/index.html")?)
6566
}

examples/subscribe/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
8686
}
8787
Msg::StartTimer => {
8888
model.timer_handle =
89-
Some(orders.stream_with_handle(streams::interval(1000, || Msg::OnTick)))
89+
Some(orders.stream_with_handle(streams::interval(1000, || Msg::OnTick)));
9090
}
9191
Msg::StopTimer => {
9292
model.timer_handle = None;

examples/tea_component/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ enum Msg {
3838
fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
3939
match msg {
4040
Msg::CounterA(msg) => {
41-
counter::update(msg, &mut model.counter_a, Msg::CounterChanged, orders)
41+
counter::update(msg, &mut model.counter_a, Msg::CounterChanged, orders);
4242
}
4343
Msg::CounterB(msg) => {
44-
counter::update(msg, &mut model.counter_b, Msg::CounterChanged, orders)
44+
counter::update(msg, &mut model.counter_b, Msg::CounterChanged, orders);
4545
}
4646
Msg::CounterClicked(counter_id) => log!("CounterClicked", counter_id),
4747
Msg::CounterChanged(value) => log!("CounterChanged", value),

examples/todomvc/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
137137
let all_todos_completed = data.todos.values().all(|todo| todo.completed);
138138

139139
for (_, todo) in &mut data.todos {
140-
todo.completed = !all_todos_completed
140+
todo.completed = !all_todos_completed;
141141
}
142142
}
143143

@@ -176,7 +176,7 @@ fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
176176
}
177177
Msg::EditingTodoTitleChanged(title) => {
178178
if let Some(ref mut editing_todo) = data.editing_todo {
179-
editing_todo.title = title
179+
editing_todo.title = title;
180180
}
181181
}
182182
Msg::SaveEditingTodo => {

examples/update_from_js/src/lib.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
4242
//
4343
// _Note:_ Create an issue in Seed's repo if this solution is not usable for you,
4444
// we can find another one or try to integrate some locks.
45-
orders.perform_cmd(async { enableClock() });
45+
orders.perform_cmd(async {
46+
enableClock();
47+
});
4648
} else {
4749
log!("JS is NOT ready!");
4850
}
@@ -81,11 +83,11 @@ pub fn start() -> Box<[JsValue]> {
8183

8284
fn create_closures_for_js(app: &App<Msg, Model, Node<Msg>>) -> Box<[JsValue]> {
8385
let js_ready = wrap_in_permanent_closure(enc!((app) move |ready| {
84-
app.update(Msg::JsReady(ready))
86+
app.update(Msg::JsReady(ready));
8587
}));
8688

8789
let tick = wrap_in_permanent_closure(enc!((app) move |time| {
88-
app.update(Msg::Tick(time))
90+
app.update(Msg::Tick(time));
8991
}));
9092

9193
vec![js_ready, tick].into_boxed_slice()

examples/url/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ enum Msg {
5555
fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
5656
match msg {
5757
Msg::UrlChanged(subs::UrlChanged(url)) => {
58-
*model = Model::new(url, orders.clone_base_path())
58+
*model = Model::new(url, orders.clone_base_path());
5959
}
6060
Msg::GoToUrl(url) => {
6161
orders.request_url(url);
@@ -79,7 +79,7 @@ fn view(model: &Model) -> Node<Msg> {
7979
("x", vec!["1"])
8080
]))
8181
.set_hash("hash")
82-
.go_and_load()
82+
.go_and_load();
8383
})
8484
],
8585
],
@@ -102,15 +102,15 @@ fn view(model: &Model) -> Node<Msg> {
102102
button![
103103
"Go to '/' and don't trigger `UrlChanged`",
104104
ev(Ev::Click, |_| {
105-
Url::new().go_and_push()
105+
Url::new().go_and_push();
106106
})
107107
],
108108
],
109109
li![
110110
button![
111111
"Go back",
112112
ev(Ev::Click, |_| {
113-
Url::go_back(1)
113+
Url::go_back(1);
114114
})
115115
],
116116
],
@@ -124,7 +124,7 @@ fn view(model: &Model) -> Node<Msg> {
124124
button![
125125
"Go to 'https://example.com'",
126126
ev(Ev::Click, |_| {
127-
Url::go_and_load_with_str("https://example.com")
127+
Url::go_and_load_with_str("https://example.com");
128128
})
129129
],
130130
],

examples/websocket/src/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,5 @@ fn handle_binary_message(client_id: usize, msg: Message) -> Message {
8383

8484
fn main() {
8585
// Listen on an address and call the closure for each connection
86-
listen("127.0.0.1:9000", |out| Server { out }).unwrap()
86+
listen("127.0.0.1:9000", |out| Server { out }).unwrap();
8787
}

src/app.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::module_name_repetitions)]
2+
13
use crate::browser::dom::virtual_dom_bridge;
24
use crate::browser::{
35
service::routing,

src/app/data.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use wasm_bindgen::closure::Closure;
66

77
type StoredPopstate = RefCell<Option<Closure<dyn FnMut(web_sys::Event)>>>;
88

9-
#[allow(clippy::type_complexity)]
9+
#[allow(clippy::type_complexity, dead_code)]
1010
pub(crate) struct AppData<Ms: 'static, Mdl> {
1111
pub model: RefCell<Option<Mdl>>,
1212
pub(crate) root_el: RefCell<Option<El<Ms>>>,

src/browser/web_socket.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::module_name_repetitions)]
2+
13
use crate::app::Orders;
24
use gloo_file::FileReadError;
35
use serde::Serialize;

0 commit comments

Comments
 (0)