summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/Cargo.toml4
-rw-r--r--core/src/keyboard/event.rs2
-rw-r--r--core/src/keyboard/modifiers.rs10
-rw-r--r--core/src/length.rs2
-rw-r--r--core/src/lib.rs24
-rw-r--r--core/src/size.rs2
-rw-r--r--core/src/vector.rs2
7 files changed, 32 insertions, 14 deletions
diff --git a/core/Cargo.toml b/core/Cargo.toml
index 92b8c56a..c9c7686e 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "iced_core"
-version = "0.4.0"
+version = "0.5.0"
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
edition = "2021"
description = "The essential concepts of Iced"
@@ -11,7 +11,7 @@ repository = "https://github.com/iced-rs/iced"
bitflags = "1.2"
[dependencies.palette]
-version = "0.5"
+version = "0.6"
optional = true
[target.'cfg(target_arch = "wasm32")'.dependencies]
diff --git a/core/src/keyboard/event.rs b/core/src/keyboard/event.rs
index 38777536..016761af 100644
--- a/core/src/keyboard/event.rs
+++ b/core/src/keyboard/event.rs
@@ -6,7 +6,7 @@ use super::{KeyCode, Modifiers};
/// additional events, feel free to [open an issue] and share your use case!_
///
/// [open an issue]: https://github.com/iced-rs/iced/issues
-#[derive(Debug, Clone, Copy, PartialEq)]
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Event {
/// A keyboard key was pressed.
KeyPressed {
diff --git a/core/src/keyboard/modifiers.rs b/core/src/keyboard/modifiers.rs
index e61f145a..bbdd8272 100644
--- a/core/src/keyboard/modifiers.rs
+++ b/core/src/keyboard/modifiers.rs
@@ -5,7 +5,7 @@ bitflags! {
#[derive(Default)]
pub struct Modifiers: u32{
/// The "shift" key.
- const SHIFT = 0b100 << 0;
+ const SHIFT = 0b100;
// const LSHIFT = 0b010 << 0;
// const RSHIFT = 0b001 << 0;
//
@@ -41,21 +41,29 @@ impl Modifiers {
};
/// Returns true if the [`SHIFT`] key is pressed in the [`Modifiers`].
+ ///
+ /// [`SHIFT`]: Self::SHIFT
pub fn shift(self) -> bool {
self.contains(Self::SHIFT)
}
/// Returns true if the [`CTRL`] key is pressed in the [`Modifiers`].
+ ///
+ /// [`CTRL`]: Self::CTRL
pub fn control(self) -> bool {
self.contains(Self::CTRL)
}
/// Returns true if the [`ALT`] key is pressed in the [`Modifiers`].
+ ///
+ /// [`ALT`]: Self::ALT
pub fn alt(self) -> bool {
self.contains(Self::ALT)
}
/// Returns true if the [`LOGO`] key is pressed in the [`Modifiers`].
+ ///
+ /// [`LOGO`]: Self::LOGO
pub fn logo(self) -> bool {
self.contains(Self::LOGO)
}
diff --git a/core/src/length.rs b/core/src/length.rs
index 186411a5..95ea6e0e 100644
--- a/core/src/length.rs
+++ b/core/src/length.rs
@@ -1,5 +1,5 @@
/// The strategy used to fill space in a specific dimension.
-#[derive(Debug, Clone, Copy, PartialEq, Hash)]
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Length {
/// Fill all the remaining space
Fill,
diff --git a/core/src/lib.rs b/core/src/lib.rs
index 3eb9f659..03ba8cca 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -7,13 +7,23 @@
//! ![The foundations of the Iced ecosystem](https://github.com/iced-rs/iced/blob/0525d76ff94e828b7b21634fa94a747022001c83/docs/graphs/foundations.png?raw=true)
//!
//! [Iced]: https://github.com/iced-rs/iced
-//! [`iced_native`]: https://github.com/iced-rs/iced/tree/master/native
-//! [`iced_web`]: https://github.com/iced-rs/iced/tree/master/web
-#![deny(missing_docs)]
-#![deny(missing_debug_implementations)]
-#![deny(unused_results)]
-#![forbid(unsafe_code)]
-#![forbid(rust_2018_idioms)]
+//! [`iced_native`]: https://github.com/iced-rs/iced/tree/0.4/native
+//! [`iced_web`]: https://github.com/iced-rs/iced_web
+#![doc(
+ html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg"
+)]
+#![deny(
+ missing_debug_implementations,
+ missing_docs,
+ 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 mod alignment;
pub mod keyboard;
pub mod mouse;
diff --git a/core/src/size.rs b/core/src/size.rs
index 6745c6c8..2db33a88 100644
--- a/core/src/size.rs
+++ b/core/src/size.rs
@@ -2,7 +2,7 @@ use crate::{Padding, Vector};
use std::f32;
/// An amount of space in 2 dimensions.
-#[derive(Debug, Clone, Copy, PartialEq)]
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Size<T = f32> {
/// The width.
pub width: T,
diff --git a/core/src/vector.rs b/core/src/vector.rs
index 92bb7648..b550869c 100644
--- a/core/src/vector.rs
+++ b/core/src/vector.rs
@@ -1,5 +1,5 @@
/// A 2D vector.
-#[derive(Debug, Clone, Copy, PartialEq)]
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Vector<T = f32> {
/// The X component of the [`Vector`]
pub x: T,