Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

must_use on app.update() #281

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/bridge_echo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions examples/bridge_echo/shared/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ mod test {
let app = AppTester::<App, _>::default();
let mut model = Model::default();

app.update(Event::Tick, &mut model);
app.update(Event::Tick, &mut model);
app.update(Event::Tick, &mut model);
let _ = app.update(Event::Tick, &mut model);
let _ = app.update(Event::Tick, &mut model);
let _ = app.update(Event::Tick, &mut model);

let actual_view = app.view(&model);
let expected_view = ViewModel { count: 3 };
Expand All @@ -91,14 +91,14 @@ mod test {
let app = AppTester::<App, _>::default();
let mut model = Model::default();

app.update(Event::Tick, &mut model);
app.update(Event::Tick, &mut model);
app.update(Event::Tick, &mut model);
app.update(Event::NewPeriod, &mut model);
app.update(Event::Tick, &mut model);
app.update(Event::Tick, &mut model);
app.update(Event::NewPeriod, &mut model);
app.update(Event::Tick, &mut model);
let _ = app.update(Event::Tick, &mut model);
let _ = app.update(Event::Tick, &mut model);
let _ = app.update(Event::Tick, &mut model);
let _ = app.update(Event::NewPeriod, &mut model);
let _ = app.update(Event::Tick, &mut model);
let _ = app.update(Event::Tick, &mut model);
let _ = app.update(Event::NewPeriod, &mut model);
let _ = app.update(Event::Tick, &mut model);

let expected = Model {
log: vec![3, 2],
Expand Down
25 changes: 13 additions & 12 deletions examples/cat_facts/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/cat_facts/shared/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ mod tests {
assert_eq!(update.events, vec![Event::SetFact(Ok(expected_response))]);

for event in update.events {
app.update(event, &mut model);
let _ = app.update(event, &mut model);
}

assert_let!(Effect::Http(request), effects.next().unwrap());
Expand All @@ -288,7 +288,7 @@ mod tests {
.resolve(request, response)
.expect("should resolve successfully");
for event in update.events {
app.update(event, &mut model);
let _ = app.update(event, &mut model);
}

assert_eq!(model.cat_fact, Some(a_fact));
Expand Down
2 changes: 1 addition & 1 deletion examples/cat_facts/shared/src/app/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ mod tests {
.resolve(request, response)
.expect("should resolve successfully");
for event in update.events {
app.update(event, &mut model);
let _ = app.update(event, &mut model);
}

assert_eq!(model.platform, "platform");
Expand Down
83 changes: 47 additions & 36 deletions examples/counter/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/counter/shared/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ mod tests {
.expect("Update to succeed");

// send the generated (internal) `Set` event back into the app
app.update(update.events[0].clone(), &mut model);
let _ = app.update(update.events[0].clone(), &mut model);

// check that the model has been updated correctly
insta::assert_yaml_snapshot!(model, @r###"
Expand Down Expand Up @@ -319,7 +319,7 @@ mod tests {
// run the event loop in order to send the (internal) `Set` event
// back into the app
for event in update.events {
app.update(event, &mut model);
let _ = app.update(event, &mut model);
}

// check that the model has been updated correctly
Expand Down
Loading
Loading