Fix clippy::default_trait_access
This commit is contained in:
parent
6c386e90a1
commit
42ed90bc6f
19 changed files with 30 additions and 28 deletions
|
|
@ -1,2 +1,2 @@
|
|||
[alias]
|
||||
lint = "clippy --workspace --no-deps -- -D warnings -D clippy::semicolon_if_nothing_returned -D clippy::trivially-copy-pass-by-ref"
|
||||
lint = "clippy --workspace --no-deps -- -D warnings -D clippy::semicolon_if_nothing_returned -D clippy::trivially-copy-pass-by-ref -D clippy::default_trait_access"
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ impl Application for Arc {
|
|||
(
|
||||
Arc {
|
||||
start: Instant::now(),
|
||||
cache: Default::default(),
|
||||
cache: Cache::default(),
|
||||
},
|
||||
Command::none(),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ impl Controls {
|
|||
pub fn new() -> Controls {
|
||||
Controls {
|
||||
background_color: Color::BLACK,
|
||||
text: Default::default(),
|
||||
text: String::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ impl Cache {
|
|||
/// Creates a new empty [`Cache`].
|
||||
pub fn new() -> Self {
|
||||
Cache {
|
||||
state: Default::default(),
|
||||
state: RefCell::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,9 +77,9 @@ where
|
|||
fn default() -> Self {
|
||||
Self {
|
||||
id: None,
|
||||
window: Default::default(),
|
||||
window: window::Settings::default(),
|
||||
flags: Default::default(),
|
||||
default_font: Default::default(),
|
||||
default_font: Font::default(),
|
||||
default_text_size: Pixels(16.0),
|
||||
antialiasing: false,
|
||||
exit_on_close_request: true,
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ impl Default for Settings {
|
|||
transparent: false,
|
||||
level: Level::default(),
|
||||
icon: None,
|
||||
platform_specific: Default::default(),
|
||||
platform_specific: PlatformSpecific::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ impl container::StyleSheet for Theme {
|
|||
|
||||
fn appearance(&self, style: &Self::Style) -> container::Appearance {
|
||||
match style {
|
||||
Container::Transparent => Default::default(),
|
||||
Container::Transparent => container::Appearance::default(),
|
||||
Container::Box => {
|
||||
let palette = self.extended_palette();
|
||||
|
||||
|
|
@ -904,7 +904,7 @@ impl svg::StyleSheet for Theme {
|
|||
|
||||
fn appearance(&self, style: &Self::Style) -> svg::Appearance {
|
||||
match style {
|
||||
Svg::Default => Default::default(),
|
||||
Svg::Default => svg::Appearance::default(),
|
||||
Svg::Custom(custom) => custom.appearance(self),
|
||||
}
|
||||
}
|
||||
|
|
@ -1053,7 +1053,7 @@ impl text::StyleSheet for Theme {
|
|||
|
||||
fn appearance(&self, style: Self::Style) -> text::Appearance {
|
||||
match style {
|
||||
Text::Default => Default::default(),
|
||||
Text::Default => text::Appearance::default(),
|
||||
Text::Color(c) => text::Appearance { color: Some(c) },
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ fn convert_path(path: &Path) -> Option<tiny_skia::Path> {
|
|||
use iced_graphics::geometry::path::lyon_path;
|
||||
|
||||
let mut builder = tiny_skia::PathBuilder::new();
|
||||
let mut last_point = Default::default();
|
||||
let mut last_point = lyon_path::math::Point::default();
|
||||
|
||||
for event in path.raw() {
|
||||
match event {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ pub fn convert(
|
|||
|
||||
let sampler = device.create_sampler(&wgpu::SamplerDescriptor {
|
||||
label: Some("iced_wgpu.offscreen.sampler"),
|
||||
..Default::default()
|
||||
..wgpu::SamplerDescriptor::default()
|
||||
});
|
||||
|
||||
//sampler in 0
|
||||
|
|
@ -102,10 +102,10 @@ pub fn convert(
|
|||
primitive: wgpu::PrimitiveState {
|
||||
topology: wgpu::PrimitiveTopology::TriangleList,
|
||||
front_face: wgpu::FrontFace::Cw,
|
||||
..Default::default()
|
||||
..wgpu::PrimitiveState::default()
|
||||
},
|
||||
depth_stencil: None,
|
||||
multisample: Default::default(),
|
||||
multisample: wgpu::MultisampleState::default(),
|
||||
multiview: None,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ impl Pipeline {
|
|||
self.renderers.push(glyphon::TextRenderer::new(
|
||||
&mut self.atlas,
|
||||
device,
|
||||
Default::default(),
|
||||
wgpu::MultisampleState::default(),
|
||||
None,
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ where
|
|||
text_line_height: text::LineHeight::default(),
|
||||
text_shaping: text::Shaping::Basic,
|
||||
font: None,
|
||||
handle: Default::default(),
|
||||
handle: Handle::default(),
|
||||
style: Default::default(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ where
|
|||
id: None,
|
||||
width: Length::Shrink,
|
||||
height: Length::Shrink,
|
||||
direction: Default::default(),
|
||||
direction: Direction::default(),
|
||||
content: content.into(),
|
||||
on_scroll: None,
|
||||
style: Default::default(),
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ where
|
|||
style,
|
||||
label_layout,
|
||||
tree.state.downcast_ref(),
|
||||
Default::default(),
|
||||
crate::text::Appearance::default(),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ impl Default for Window {
|
|||
transparent: false,
|
||||
level: Level::default(),
|
||||
icon: None,
|
||||
platform_specific: Default::default(),
|
||||
platform_specific: PlatformSpecific::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue