summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-20 04:51:08 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-20 04:51:08 +0200
commit42ed90bc6f92b2085d193e7f143430b8d3847c21 (patch)
tree708166baa85036ab80ee96f7379a8767b7691da6 /examples
parent6c386e90a12fd26da12541da3f086dddb7211c0c (diff)
downloadiced-42ed90bc6f92b2085d193e7f143430b8d3847c21.tar.gz
iced-42ed90bc6f92b2085d193e7f143430b8d3847c21.tar.bz2
iced-42ed90bc6f92b2085d193e7f143430b8d3847c21.zip
Fix `clippy::default_trait_access`
Diffstat (limited to 'examples')
-rw-r--r--examples/arc/src/main.rs2
-rw-r--r--examples/clock/src/main.rs2
-rw-r--r--examples/integration/src/controls.rs2
-rw-r--r--examples/lazy/src/main.rs4
-rw-r--r--examples/modal/src/main.rs6
-rw-r--r--examples/scrollable/src/main.rs4
-rw-r--r--examples/solar_system/src/main.rs4
7 files changed, 13 insertions, 11 deletions
diff --git a/examples/arc/src/main.rs b/examples/arc/src/main.rs
index df565859..6a68cca1 100644
--- a/examples/arc/src/main.rs
+++ b/examples/arc/src/main.rs
@@ -37,7 +37,7 @@ impl Application for Arc {
(
Arc {
start: Instant::now(),
- cache: Default::default(),
+ cache: Cache::default(),
},
Command::none(),
)
diff --git a/examples/clock/src/main.rs b/examples/clock/src/main.rs
index eec70dde..920aa0c5 100644
--- a/examples/clock/src/main.rs
+++ b/examples/clock/src/main.rs
@@ -35,7 +35,7 @@ impl Application for Clock {
Clock {
now: time::OffsetDateTime::now_local()
.unwrap_or_else(|_| time::OffsetDateTime::now_utc()),
- clock: Default::default(),
+ clock: Cache::default(),
},
Command::none(),
)
diff --git a/examples/integration/src/controls.rs b/examples/integration/src/controls.rs
index 14e53ede..4714c397 100644
--- a/examples/integration/src/controls.rs
+++ b/examples/integration/src/controls.rs
@@ -19,7 +19,7 @@ impl Controls {
pub fn new() -> Controls {
Controls {
background_color: Color::BLACK,
- text: Default::default(),
+ text: String::default(),
}
}
diff --git a/examples/lazy/src/main.rs b/examples/lazy/src/main.rs
index c6baa6a1..9bf17c56 100644
--- a/examples/lazy/src/main.rs
+++ b/examples/lazy/src/main.rs
@@ -27,7 +27,7 @@ impl Default for App {
.into_iter()
.map(From::from)
.collect(),
- input: Default::default(),
+ input: String::default(),
order: Order::Ascending,
}
}
@@ -107,7 +107,7 @@ impl From<&str> for Item {
fn from(s: &str) -> Self {
Self {
name: s.to_owned(),
- color: Default::default(),
+ color: Color::default(),
}
}
}
diff --git a/examples/modal/src/main.rs b/examples/modal/src/main.rs
index c050d3cc..b0e2c81b 100644
--- a/examples/modal/src/main.rs
+++ b/examples/modal/src/main.rs
@@ -228,7 +228,9 @@ mod modal {
use iced::alignment::Alignment;
use iced::event;
use iced::mouse;
- use iced::{Color, Element, Event, Length, Point, Rectangle, Size};
+ use iced::{
+ BorderRadius, Color, Element, Event, Length, Point, Rectangle, Size,
+ };
/// A widget that centers a modal element over some base element
pub struct Modal<'a, Message, Renderer> {
@@ -474,7 +476,7 @@ mod modal {
renderer.fill_quad(
renderer::Quad {
bounds: layout.bounds(),
- border_radius: Default::default(),
+ border_radius: BorderRadius::default(),
border_width: 0.0,
border_color: Color::TRANSPARENT,
},
diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs
index 21e69284..d82ea841 100644
--- a/examples/scrollable/src/main.rs
+++ b/examples/scrollable/src/main.rs
@@ -391,12 +391,12 @@ impl scrollable::StyleSheet for ScrollbarCustomStyle {
.background,
border_radius: 2.0.into(),
border_width: 0.0,
- border_color: Default::default(),
+ border_color: Color::default(),
scroller: Scroller {
color: Color::from_rgb8(250, 85, 134),
border_radius: 2.0.into(),
border_width: 0.0,
- border_color: Default::default(),
+ border_color: Color::default(),
},
}
} else {
diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs
index 8fa8946e..8295dded 100644
--- a/examples/solar_system/src/main.rs
+++ b/examples/solar_system/src/main.rs
@@ -117,8 +117,8 @@ impl State {
let (width, height) = window::Settings::default().size;
State {
- space_cache: Default::default(),
- system_cache: Default::default(),
+ space_cache: canvas::Cache::default(),
+ system_cache: canvas::Cache::default(),
start: now,
now,
stars: Self::generate_stars(width, height),