Fix further clippy lints
... and explicitly annotate crates as well.
This commit is contained in:
parent
33a24b5821
commit
2f76a10a1d
33 changed files with 197 additions and 85 deletions
|
|
@ -5,7 +5,7 @@ bitflags! {
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct Modifiers: u32{
|
pub struct Modifiers: u32{
|
||||||
/// The "shift" key.
|
/// The "shift" key.
|
||||||
const SHIFT = 0b100 << 0;
|
const SHIFT = 0b100;
|
||||||
// const LSHIFT = 0b010 << 0;
|
// const LSHIFT = 0b010 << 0;
|
||||||
// const RSHIFT = 0b001 << 0;
|
// const RSHIFT = 0b001 << 0;
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,18 @@
|
||||||
#![doc(
|
#![doc(
|
||||||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||||
)]
|
)]
|
||||||
#![deny(missing_docs)]
|
#![deny(
|
||||||
#![deny(missing_debug_implementations)]
|
missing_debug_implementations,
|
||||||
#![deny(unused_results)]
|
missing_docs,
|
||||||
#![forbid(unsafe_code)]
|
unused_results,
|
||||||
#![forbid(rust_2018_idioms)]
|
clippy::extra_unused_lifetimes,
|
||||||
|
clippy::from_over_into,
|
||||||
|
clippy::needless_borrow,
|
||||||
|
clippy::new_without_default,
|
||||||
|
clippy::useless_conversion
|
||||||
|
)]
|
||||||
|
#![forbid(unsafe_code, rust_2018_idioms)]
|
||||||
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
pub mod alignment;
|
pub mod alignment;
|
||||||
pub mod keyboard;
|
pub mod keyboard;
|
||||||
pub mod mouse;
|
pub mod mouse;
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,19 @@
|
||||||
#![doc(
|
#![doc(
|
||||||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||||
)]
|
)]
|
||||||
#![deny(missing_docs)]
|
#![deny(
|
||||||
#![deny(missing_debug_implementations)]
|
missing_debug_implementations,
|
||||||
#![deny(unused_results)]
|
missing_docs,
|
||||||
#![forbid(unsafe_code)]
|
unused_results,
|
||||||
#![forbid(rust_2018_idioms)]
|
clippy::extra_unused_lifetimes,
|
||||||
|
clippy::from_over_into,
|
||||||
|
clippy::needless_borrow,
|
||||||
|
clippy::new_without_default,
|
||||||
|
clippy::useless_conversion
|
||||||
|
)]
|
||||||
|
#![forbid(unsafe_code, rust_2018_idioms)]
|
||||||
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
|
||||||
pub use futures;
|
pub use futures;
|
||||||
|
|
||||||
mod command;
|
mod command;
|
||||||
|
|
|
||||||
|
|
@ -66,8 +66,6 @@ where
|
||||||
|
|
||||||
let future = future.then(|message| async move {
|
let future = future.then(|message| async move {
|
||||||
let _ = sender.send(message).await;
|
let _ = sender.send(message).await;
|
||||||
|
|
||||||
()
|
|
||||||
});
|
});
|
||||||
|
|
||||||
self.executor.spawn(future);
|
self.executor.spawn(future);
|
||||||
|
|
|
||||||
|
|
@ -156,3 +156,13 @@ where
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<Hasher, Event> Default for Tracker<Hasher, Event>
|
||||||
|
where
|
||||||
|
Hasher: std::hash::Hasher + Default,
|
||||||
|
Event: 'static + Send + Clone,
|
||||||
|
{
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,18 @@
|
||||||
#![doc(
|
#![doc(
|
||||||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||||
)]
|
)]
|
||||||
#![deny(missing_docs)]
|
#![deny(
|
||||||
#![deny(missing_debug_implementations)]
|
missing_debug_implementations,
|
||||||
#![deny(unused_results)]
|
missing_docs,
|
||||||
|
unused_results,
|
||||||
|
clippy::extra_unused_lifetimes,
|
||||||
|
clippy::from_over_into,
|
||||||
|
clippy::needless_borrow,
|
||||||
|
clippy::new_without_default,
|
||||||
|
clippy::useless_conversion
|
||||||
|
)]
|
||||||
#![forbid(rust_2018_idioms)]
|
#![forbid(rust_2018_idioms)]
|
||||||
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
|
||||||
pub use glow;
|
pub use glow;
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,20 @@
|
||||||
#![doc(
|
#![doc(
|
||||||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||||
)]
|
)]
|
||||||
#![deny(missing_docs)]
|
#![deny(
|
||||||
#![deny(missing_debug_implementations)]
|
missing_docs,
|
||||||
#![deny(unused_results)]
|
missing_debug_implementations,
|
||||||
#![deny(unsafe_code)]
|
unsafe_code,
|
||||||
|
unused_results,
|
||||||
|
clippy::extra_unused_lifetimes,
|
||||||
|
clippy::from_over_into,
|
||||||
|
clippy::needless_borrow,
|
||||||
|
clippy::new_without_default,
|
||||||
|
clippy::useless_conversion
|
||||||
|
)]
|
||||||
#![forbid(rust_2018_idioms)]
|
#![forbid(rust_2018_idioms)]
|
||||||
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
|
||||||
pub use glutin;
|
pub use glutin;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,19 @@
|
||||||
#![doc(
|
#![doc(
|
||||||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||||
)]
|
)]
|
||||||
#![deny(missing_docs)]
|
#![deny(
|
||||||
#![deny(missing_debug_implementations)]
|
missing_debug_implementations,
|
||||||
#![deny(unused_results)]
|
missing_docs,
|
||||||
#![deny(unsafe_code)]
|
unsafe_code,
|
||||||
|
unused_results,
|
||||||
|
clippy::extra_unused_lifetimes,
|
||||||
|
clippy::from_over_into,
|
||||||
|
clippy::needless_borrow,
|
||||||
|
clippy::new_without_default,
|
||||||
|
clippy::useless_conversion
|
||||||
|
)]
|
||||||
#![forbid(rust_2018_idioms)]
|
#![forbid(rust_2018_idioms)]
|
||||||
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
mod antialiasing;
|
mod antialiasing;
|
||||||
mod error;
|
mod error;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ pub trait Component<Message, Renderer> {
|
||||||
|
|
||||||
/// Produces the widgets of the [`Component`], which may trigger an [`Event`](Component::Event)
|
/// Produces the widgets of the [`Component`], which may trigger an [`Event`](Component::Event)
|
||||||
/// on user interaction.
|
/// on user interaction.
|
||||||
fn view(&mut self) -> Element<Self::Event, Renderer>;
|
fn view(&mut self) -> Element<'_, Self::Event, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Turns an implementor of [`Component`] into an [`Element`] that can be
|
/// Turns an implementor of [`Component`] into an [`Element`] that can be
|
||||||
|
|
@ -350,7 +350,7 @@ where
|
||||||
layout: Layout<'_>,
|
layout: Layout<'_>,
|
||||||
cursor_position: Point,
|
cursor_position: Point,
|
||||||
) {
|
) {
|
||||||
self.with_overlay_maybe(|overlay| {
|
let _ = self.with_overlay_maybe(|overlay| {
|
||||||
overlay.draw(renderer, theme, style, layout, cursor_position);
|
overlay.draw(renderer, theme, style, layout, cursor_position);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,17 @@
|
||||||
#![doc(
|
#![doc(
|
||||||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||||
)]
|
)]
|
||||||
|
#![deny(
|
||||||
|
missing_debug_implementations,
|
||||||
|
unused_results,
|
||||||
|
clippy::extra_unused_lifetimes,
|
||||||
|
clippy::from_over_into,
|
||||||
|
clippy::needless_borrow,
|
||||||
|
clippy::new_without_default,
|
||||||
|
clippy::useless_conversion
|
||||||
|
)]
|
||||||
|
#![forbid(unsafe_code)]
|
||||||
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
pub mod component;
|
pub mod component;
|
||||||
pub mod responsive;
|
pub mod responsive;
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ pub trait Component<Message, Renderer> {
|
||||||
|
|
||||||
/// Produces the widgets of the [`Component`], which may trigger an [`Event`](Component::Event)
|
/// Produces the widgets of the [`Component`], which may trigger an [`Event`](Component::Event)
|
||||||
/// on user interaction.
|
/// on user interaction.
|
||||||
fn view(&self, state: &Self::State) -> Element<Self::Event, Renderer>;
|
fn view(&self, state: &Self::State) -> Element<'_, Self::Event, Renderer>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Turns an implementor of [`Component`] into an [`Element`] that can be
|
/// Turns an implementor of [`Component`] into an [`Element`] that can be
|
||||||
|
|
@ -382,7 +382,7 @@ where
|
||||||
layout: Layout<'_>,
|
layout: Layout<'_>,
|
||||||
cursor_position: Point,
|
cursor_position: Point,
|
||||||
) {
|
) {
|
||||||
self.with_overlay_maybe(|overlay| {
|
let _ = self.with_overlay_maybe(|overlay| {
|
||||||
overlay.draw(renderer, theme, style, layout, cursor_position);
|
overlay.draw(renderer, theme, style, layout, cursor_position);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -341,7 +341,7 @@ where
|
||||||
layout: Layout<'_>,
|
layout: Layout<'_>,
|
||||||
cursor_position: Point,
|
cursor_position: Point,
|
||||||
) {
|
) {
|
||||||
self.with_overlay_maybe(|overlay| {
|
let _ = self.with_overlay_maybe(|overlay| {
|
||||||
overlay.draw(renderer, theme, style, layout, cursor_position);
|
overlay.draw(renderer, theme, style, layout, cursor_position);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -363,7 +363,7 @@ where
|
||||||
layout: Layout<'_>,
|
layout: Layout<'_>,
|
||||||
cursor_position: Point,
|
cursor_position: Point,
|
||||||
) {
|
) {
|
||||||
self.with_overlay_maybe(|overlay| {
|
let _ = self.with_overlay_maybe(|overlay| {
|
||||||
overlay.draw(renderer, theme, style, layout, cursor_position);
|
overlay.draw(renderer, theme, style, layout, cursor_position);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#![allow(missing_docs)]
|
#![allow(missing_docs)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Default)]
|
||||||
pub struct Debug;
|
pub struct Debug;
|
||||||
|
|
||||||
impl Debug {
|
impl Debug {
|
||||||
|
|
|
||||||
|
|
@ -31,11 +31,19 @@
|
||||||
#![doc(
|
#![doc(
|
||||||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||||
)]
|
)]
|
||||||
#![deny(missing_docs)]
|
#![deny(
|
||||||
#![deny(missing_debug_implementations)]
|
missing_debug_implementations,
|
||||||
#![deny(unused_results)]
|
missing_docs,
|
||||||
#![forbid(unsafe_code)]
|
unused_results,
|
||||||
#![forbid(rust_2018_idioms)]
|
clippy::extra_unused_lifetimes,
|
||||||
|
clippy::from_over_into,
|
||||||
|
clippy::needless_borrow,
|
||||||
|
clippy::new_without_default,
|
||||||
|
clippy::useless_conversion
|
||||||
|
)]
|
||||||
|
#![forbid(unsafe_code, rust_2018_idioms)]
|
||||||
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
pub mod clipboard;
|
pub mod clipboard;
|
||||||
pub mod command;
|
pub mod command;
|
||||||
pub mod event;
|
pub mod event;
|
||||||
|
|
|
||||||
|
|
@ -489,15 +489,15 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T, Message, Renderer> Into<Element<'a, Message, Renderer>>
|
impl<'a, T, Message, Renderer> From<List<'a, T, Renderer>>
|
||||||
for List<'a, T, Renderer>
|
for Element<'a, Message, Renderer>
|
||||||
where
|
where
|
||||||
T: ToString + Clone,
|
T: ToString + Clone,
|
||||||
Message: 'a,
|
Message: 'a,
|
||||||
Renderer: 'a + text::Renderer,
|
Renderer: 'a + text::Renderer,
|
||||||
Renderer::Theme: StyleSheet,
|
Renderer::Theme: StyleSheet,
|
||||||
{
|
{
|
||||||
fn into(self) -> Element<'a, Message, Renderer> {
|
fn from(list: List<'a, T, Renderer>) -> Self {
|
||||||
Element::new(self)
|
Element::new(list)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ use crate::{Background, Font, Point, Rectangle, Size, Theme, Vector};
|
||||||
/// A renderer that does nothing.
|
/// A renderer that does nothing.
|
||||||
///
|
///
|
||||||
/// It can be useful if you are writing tests!
|
/// It can be useful if you are writing tests!
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy, Default)]
|
||||||
pub struct Null;
|
pub struct Null;
|
||||||
|
|
||||||
impl Null {
|
impl Null {
|
||||||
|
|
|
||||||
|
|
@ -382,7 +382,7 @@ where
|
||||||
self.on_press.is_some(),
|
self.on_press.is_some(),
|
||||||
theme,
|
theme,
|
||||||
self.style,
|
self.style,
|
||||||
|| &self.state,
|
|| self.state,
|
||||||
);
|
);
|
||||||
|
|
||||||
self.content.draw(
|
self.content.draw(
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,12 @@ impl<'a, Message, Renderer> Column<'a, Message, Renderer> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, Message, Renderer> Default for Column<'a, Message, Renderer> {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a, Message, Renderer> Widget<Message, Renderer>
|
impl<'a, Message, Renderer> Widget<Message, Renderer>
|
||||||
for Column<'a, Message, Renderer>
|
for Column<'a, Message, Renderer>
|
||||||
where
|
where
|
||||||
|
|
|
||||||
|
|
@ -525,7 +525,7 @@ where
|
||||||
) -> Option<overlay::Element<'_, Message, Renderer>> {
|
) -> Option<overlay::Element<'_, Message, Renderer>> {
|
||||||
overlay(
|
overlay(
|
||||||
layout,
|
layout,
|
||||||
&mut self.state,
|
self.state,
|
||||||
self.padding,
|
self.padding,
|
||||||
self.text_size,
|
self.text_size,
|
||||||
self.font.clone(),
|
self.font.clone(),
|
||||||
|
|
@ -535,8 +535,8 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T: 'a, Message, Renderer> Into<Element<'a, Message, Renderer>>
|
impl<'a, T: 'a, Message, Renderer> From<PickList<'a, T, Message, Renderer>>
|
||||||
for PickList<'a, T, Message, Renderer>
|
for Element<'a, Message, Renderer>
|
||||||
where
|
where
|
||||||
T: Clone + ToString + Eq,
|
T: Clone + ToString + Eq,
|
||||||
[T]: ToOwned<Owned = Vec<T>>,
|
[T]: ToOwned<Owned = Vec<T>>,
|
||||||
|
|
@ -549,7 +549,7 @@ where
|
||||||
<Renderer::Theme as StyleSheet>::Style:
|
<Renderer::Theme as StyleSheet>::Style:
|
||||||
Into<<Renderer::Theme as menu::StyleSheet>::Style>,
|
Into<<Renderer::Theme as menu::StyleSheet>::Style>,
|
||||||
{
|
{
|
||||||
fn into(self) -> Element<'a, Message, Renderer> {
|
fn from(pick_list: PickList<'a, T, Message, Renderer>) -> Self {
|
||||||
Element::new(self)
|
Element::new(pick_list)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Message, Renderer> Widget<Message, Renderer> for ProgressBar<Renderer>
|
impl<Message, Renderer> Widget<Message, Renderer> for ProgressBar<Renderer>
|
||||||
where
|
where
|
||||||
Renderer: crate::Renderer,
|
Renderer: crate::Renderer,
|
||||||
Renderer::Theme: StyleSheet,
|
Renderer::Theme: StyleSheet,
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,12 @@ impl<'a, Message, Renderer> Row<'a, Message, Renderer> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, Message, Renderer> Default for Row<'a, Message, Renderer> {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a, Message, Renderer> Widget<Message, Renderer>
|
impl<'a, Message, Renderer> Widget<Message, Renderer>
|
||||||
for Row<'a, Message, Renderer>
|
for Row<'a, Message, Renderer>
|
||||||
where
|
where
|
||||||
|
|
|
||||||
|
|
@ -662,7 +662,7 @@ where
|
||||||
shell: &mut Shell<'_, Message>,
|
shell: &mut Shell<'_, Message>,
|
||||||
) -> event::Status {
|
) -> event::Status {
|
||||||
update(
|
update(
|
||||||
&mut self.state,
|
self.state,
|
||||||
event,
|
event,
|
||||||
layout,
|
layout,
|
||||||
cursor_position,
|
cursor_position,
|
||||||
|
|
@ -693,7 +693,7 @@ where
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
) -> mouse::Interaction {
|
) -> mouse::Interaction {
|
||||||
mouse_interaction(
|
mouse_interaction(
|
||||||
&self.state,
|
self.state,
|
||||||
layout,
|
layout,
|
||||||
cursor_position,
|
cursor_position,
|
||||||
self.scrollbar_width,
|
self.scrollbar_width,
|
||||||
|
|
@ -720,7 +720,7 @@ where
|
||||||
_viewport: &Rectangle,
|
_viewport: &Rectangle,
|
||||||
) {
|
) {
|
||||||
draw(
|
draw(
|
||||||
&self.state,
|
self.state,
|
||||||
renderer,
|
renderer,
|
||||||
theme,
|
theme,
|
||||||
layout,
|
layout,
|
||||||
|
|
|
||||||
|
|
@ -410,7 +410,7 @@ where
|
||||||
layout,
|
layout,
|
||||||
cursor_position,
|
cursor_position,
|
||||||
shell,
|
shell,
|
||||||
&mut self.state,
|
self.state,
|
||||||
&mut self.value,
|
&mut self.value,
|
||||||
&self.range,
|
&self.range,
|
||||||
self.step,
|
self.step,
|
||||||
|
|
@ -432,7 +432,7 @@ where
|
||||||
renderer,
|
renderer,
|
||||||
layout,
|
layout,
|
||||||
cursor_position,
|
cursor_position,
|
||||||
&self.state,
|
self.state,
|
||||||
self.value,
|
self.value,
|
||||||
&self.range,
|
&self.range,
|
||||||
theme,
|
theme,
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,7 @@ where
|
||||||
theme,
|
theme,
|
||||||
layout,
|
layout,
|
||||||
cursor_position,
|
cursor_position,
|
||||||
&self.state,
|
self.state,
|
||||||
value.unwrap_or(&self.value),
|
value.unwrap_or(&self.value),
|
||||||
&self.placeholder,
|
&self.placeholder,
|
||||||
self.size,
|
self.size,
|
||||||
|
|
|
||||||
|
|
@ -82,10 +82,18 @@
|
||||||
#![doc(
|
#![doc(
|
||||||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||||
)]
|
)]
|
||||||
#![deny(missing_docs)]
|
#![deny(
|
||||||
#![deny(unused_results)]
|
missing_docs,
|
||||||
#![forbid(unsafe_code)]
|
unused_results,
|
||||||
#![forbid(rust_2018_idioms)]
|
clippy::extra_unused_lifetimes,
|
||||||
|
clippy::from_over_into,
|
||||||
|
clippy::needless_borrow,
|
||||||
|
clippy::new_without_default,
|
||||||
|
clippy::useless_conversion
|
||||||
|
)]
|
||||||
|
#![forbid(rust_2018_idioms, unsafe_code)]
|
||||||
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
|
||||||
pub mod flex;
|
pub mod flex;
|
||||||
pub mod helpers;
|
pub mod helpers;
|
||||||
|
|
|
||||||
18
src/lib.rs
18
src/lib.rs
|
|
@ -174,12 +174,20 @@
|
||||||
#![doc(
|
#![doc(
|
||||||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||||
)]
|
)]
|
||||||
#![deny(missing_docs)]
|
#![deny(
|
||||||
#![deny(missing_debug_implementations)]
|
missing_debug_implementations,
|
||||||
#![deny(unused_results)]
|
missing_docs,
|
||||||
#![forbid(unsafe_code)]
|
unused_results,
|
||||||
#![forbid(rust_2018_idioms)]
|
clippy::extra_unused_lifetimes,
|
||||||
|
clippy::from_over_into,
|
||||||
|
clippy::needless_borrow,
|
||||||
|
clippy::new_without_default,
|
||||||
|
clippy::useless_conversion
|
||||||
|
)]
|
||||||
|
#![forbid(rust_2018_idioms, unsafe_code)]
|
||||||
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
|
||||||
mod element;
|
mod element;
|
||||||
mod error;
|
mod error;
|
||||||
mod result;
|
mod result;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,16 @@
|
||||||
#![doc(
|
#![doc(
|
||||||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||||
)]
|
)]
|
||||||
|
#![deny(
|
||||||
|
unused_results,
|
||||||
|
clippy::extra_unused_lifetimes,
|
||||||
|
clippy::from_over_into,
|
||||||
|
clippy::needless_borrow,
|
||||||
|
clippy::new_without_default,
|
||||||
|
clippy::useless_conversion
|
||||||
|
)]
|
||||||
|
#![forbid(unsafe_code, rust_2018_idioms)]
|
||||||
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
pub use iced_core::{Background, Color};
|
pub use iced_core::{Background, Color};
|
||||||
|
|
||||||
pub mod application;
|
pub mod application;
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,7 @@ pub trait StyleSheet {
|
||||||
fn appearance(&self, style: Self::Style) -> Appearance;
|
fn appearance(&self, style: Self::Style) -> Appearance;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy, Default)]
|
||||||
pub struct Appearance {
|
pub struct Appearance {
|
||||||
pub color: Option<Color>,
|
pub color: Option<Color>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Appearance {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self { color: None }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -419,7 +419,7 @@ impl radio::StyleSheet for Theme {
|
||||||
|
|
||||||
radio::Appearance {
|
radio::Appearance {
|
||||||
background: Color::TRANSPARENT.into(),
|
background: Color::TRANSPARENT.into(),
|
||||||
dot_color: palette.primary.strong.color.into(),
|
dot_color: palette.primary.strong.color,
|
||||||
border_width: 1.0,
|
border_width: 1.0,
|
||||||
border_color: palette.primary.strong.color,
|
border_color: palette.primary.strong.color,
|
||||||
text_color: None,
|
text_color: None,
|
||||||
|
|
@ -431,7 +431,7 @@ impl radio::StyleSheet for Theme {
|
||||||
let palette = self.extended_palette();
|
let palette = self.extended_palette();
|
||||||
|
|
||||||
radio::Appearance {
|
radio::Appearance {
|
||||||
dot_color: palette.primary.strong.color.into(),
|
dot_color: palette.primary.strong.color,
|
||||||
background: palette.primary.weak.color.into(),
|
background: palette.primary.weak.color.into(),
|
||||||
..active
|
..active
|
||||||
}
|
}
|
||||||
|
|
@ -599,7 +599,7 @@ impl scrollable::StyleSheet for Theme {
|
||||||
border_width: 0.0,
|
border_width: 0.0,
|
||||||
border_color: Color::TRANSPARENT,
|
border_color: Color::TRANSPARENT,
|
||||||
scroller: scrollable::Scroller {
|
scroller: scrollable::Scroller {
|
||||||
color: palette.background.strong.color.into(),
|
color: palette.background.strong.color,
|
||||||
border_radius: 2.0,
|
border_radius: 2.0,
|
||||||
border_width: 0.0,
|
border_width: 0.0,
|
||||||
border_color: Color::TRANSPARENT,
|
border_color: Color::TRANSPARENT,
|
||||||
|
|
@ -616,7 +616,7 @@ impl scrollable::StyleSheet for Theme {
|
||||||
border_width: 0.0,
|
border_width: 0.0,
|
||||||
border_color: Color::TRANSPARENT,
|
border_color: Color::TRANSPARENT,
|
||||||
scroller: scrollable::Scroller {
|
scroller: scrollable::Scroller {
|
||||||
color: palette.primary.strong.color.into(),
|
color: palette.primary.strong.color,
|
||||||
border_radius: 2.0,
|
border_radius: 2.0,
|
||||||
border_width: 0.0,
|
border_width: 0.0,
|
||||||
border_color: Color::TRANSPARENT,
|
border_color: Color::TRANSPARENT,
|
||||||
|
|
|
||||||
|
|
@ -230,7 +230,6 @@ impl Backend {
|
||||||
wgpu_glyph::VerticalAlign::Bottom
|
wgpu_glyph::VerticalAlign::Bottom
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
..Default::default()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
self.text_pipeline.queue(text);
|
self.text_pipeline.queue(text);
|
||||||
|
|
|
||||||
|
|
@ -23,11 +23,19 @@
|
||||||
#![doc(
|
#![doc(
|
||||||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||||
)]
|
)]
|
||||||
#![deny(missing_docs)]
|
#![deny(
|
||||||
#![deny(missing_debug_implementations)]
|
missing_debug_implementations,
|
||||||
#![deny(unused_results)]
|
missing_docs,
|
||||||
#![deny(unsafe_code)]
|
unsafe_code,
|
||||||
|
unused_results,
|
||||||
|
clippy::extra_unused_lifetimes,
|
||||||
|
clippy::from_over_into,
|
||||||
|
clippy::needless_borrow,
|
||||||
|
clippy::new_without_default,
|
||||||
|
clippy::useless_conversion
|
||||||
|
)]
|
||||||
#![forbid(rust_2018_idioms)]
|
#![forbid(rust_2018_idioms)]
|
||||||
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
|
||||||
pub mod settings;
|
pub mod settings;
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,19 @@
|
||||||
#![doc(
|
#![doc(
|
||||||
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
|
||||||
)]
|
)]
|
||||||
#![deny(missing_docs)]
|
#![deny(
|
||||||
#![deny(missing_debug_implementations)]
|
missing_debug_implementations,
|
||||||
#![deny(unused_results)]
|
missing_docs,
|
||||||
#![forbid(unsafe_code)]
|
unused_results,
|
||||||
#![forbid(rust_2018_idioms)]
|
clippy::extra_unused_lifetimes,
|
||||||
|
clippy::from_over_into,
|
||||||
|
clippy::needless_borrow,
|
||||||
|
clippy::new_without_default,
|
||||||
|
clippy::useless_conversion
|
||||||
|
)]
|
||||||
|
#![forbid(rust_2018_idioms, unsafe_code)]
|
||||||
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
|
||||||
#[doc(no_inline)]
|
#[doc(no_inline)]
|
||||||
pub use iced_native::*;
|
pub use iced_native::*;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue