summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--core/src/gradient.rs2
-rw-r--r--core/src/widget/text.rs2
-rw-r--r--examples/game_of_life/src/main.rs2
-rw-r--r--examples/tour/src/main.rs2
-rw-r--r--graphics/src/gradient.rs2
-rw-r--r--runtime/src/debug/basic.rs20
-rw-r--r--tiny_skia/src/geometry.rs2
7 files changed, 13 insertions, 19 deletions
diff --git a/core/src/gradient.rs b/core/src/gradient.rs
index 4a0d5ea0..6a5533f8 100644
--- a/core/src/gradient.rs
+++ b/core/src/gradient.rs
@@ -94,7 +94,7 @@ impl Linear {
mut self,
stops: impl IntoIterator<Item = ColorStop>,
) -> Self {
- for stop in stops.into_iter() {
+ for stop in stops {
self = self.add_stop(stop.offset, stop.color)
}
diff --git a/core/src/widget/text.rs b/core/src/widget/text.rs
index 53ed463e..ba98f2d8 100644
--- a/core/src/widget/text.rs
+++ b/core/src/widget/text.rs
@@ -220,9 +220,9 @@ where
size,
line_height,
font,
- shaping,
horizontal_alignment,
vertical_alignment,
+ shaping,
},
);
diff --git a/examples/game_of_life/src/main.rs b/examples/game_of_life/src/main.rs
index e451cb06..e3089beb 100644
--- a/examples/game_of_life/src/main.rs
+++ b/examples/game_of_life/src/main.rs
@@ -793,7 +793,7 @@ mod grid {
}
}
- for (cell, amount) in adjacent_life.iter() {
+ for (cell, amount) in &adjacent_life {
match amount {
2 => {}
3 => {
diff --git a/examples/tour/src/main.rs b/examples/tour/src/main.rs
index 3e3a8ad7..952300bb 100644
--- a/examples/tour/src/main.rs
+++ b/examples/tour/src/main.rs
@@ -482,7 +482,7 @@ impl<'a> Step {
column(
Language::all()
.iter()
- .cloned()
+ .copied()
.map(|language| {
radio(
language,
diff --git a/graphics/src/gradient.rs b/graphics/src/gradient.rs
index b274ec86..7460e12e 100644
--- a/graphics/src/gradient.rs
+++ b/graphics/src/gradient.rs
@@ -87,7 +87,7 @@ impl Linear {
mut self,
stops: impl IntoIterator<Item = ColorStop>,
) -> Self {
- for stop in stops.into_iter() {
+ for stop in stops {
self = self.add_stop(stop.offset, stop.color)
}
diff --git a/runtime/src/debug/basic.rs b/runtime/src/debug/basic.rs
index 32f725a1..4c994a2f 100644
--- a/runtime/src/debug/basic.rs
+++ b/runtime/src/debug/basic.rs
@@ -75,7 +75,7 @@ impl Debug {
}
pub fn startup_finished(&mut self) {
- self.startup_duration = time::Instant::now() - self.startup_start;
+ self.startup_duration = self.startup_start.elapsed();
}
pub fn update_started(&mut self) {
@@ -83,8 +83,7 @@ impl Debug {
}
pub fn update_finished(&mut self) {
- self.update_durations
- .push(time::Instant::now() - self.update_start);
+ self.update_durations.push(self.update_start.elapsed());
}
pub fn view_started(&mut self) {
@@ -92,8 +91,7 @@ impl Debug {
}
pub fn view_finished(&mut self) {
- self.view_durations
- .push(time::Instant::now() - self.view_start);
+ self.view_durations.push(self.view_start.elapsed());
}
pub fn layout_started(&mut self) {
@@ -101,8 +99,7 @@ impl Debug {
}
pub fn layout_finished(&mut self) {
- self.layout_durations
- .push(time::Instant::now() - self.layout_start);
+ self.layout_durations.push(self.layout_start.elapsed());
}
pub fn event_processing_started(&mut self) {
@@ -110,8 +107,7 @@ impl Debug {
}
pub fn event_processing_finished(&mut self) {
- self.event_durations
- .push(time::Instant::now() - self.event_start);
+ self.event_durations.push(self.event_start.elapsed());
}
pub fn draw_started(&mut self) {
@@ -119,8 +115,7 @@ impl Debug {
}
pub fn draw_finished(&mut self) {
- self.draw_durations
- .push(time::Instant::now() - self.draw_start);
+ self.draw_durations.push(self.draw_start.elapsed());
}
pub fn render_started(&mut self) {
@@ -128,8 +123,7 @@ impl Debug {
}
pub fn render_finished(&mut self) {
- self.render_durations
- .push(time::Instant::now() - self.render_start);
+ self.render_durations.push(self.render_start.elapsed());
}
pub fn log_message<Message: std::fmt::Debug>(&mut self, message: &Message) {
diff --git a/tiny_skia/src/geometry.rs b/tiny_skia/src/geometry.rs
index 047bc0ff..1d573f6a 100644
--- a/tiny_skia/src/geometry.rs
+++ b/tiny_skia/src/geometry.rs
@@ -182,7 +182,7 @@ fn convert_path(path: &Path) -> Option<tiny_skia::Path> {
let mut builder = tiny_skia::PathBuilder::new();
let mut last_point = Default::default();
- for event in path.raw().iter() {
+ for event in path.raw() {
match event {
lyon_path::Event::Begin { at } => {
builder.move_to(at.x, at.y);