summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-07-20 21:34:20 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-07-20 21:34:44 +0700
commit82db3c78b6cfa2cc55ece6ffa46811bfb5195f60 (patch)
tree49b1011ad3dbc4fec78a52fef78628754ae9217e
parentb97954a1ee3ec7bc85d1d41b397e994752ff1831 (diff)
downloadiced-82db3c78b6cfa2cc55ece6ffa46811bfb5195f60.tar.gz
iced-82db3c78b6cfa2cc55ece6ffa46811bfb5195f60.tar.bz2
iced-82db3c78b6cfa2cc55ece6ffa46811bfb5195f60.zip
Update `winit` and `glutin` dependencies
... and remove crates.io patch
-rw-r--r--Cargo.toml3
-rw-r--r--glutin/Cargo.toml4
-rw-r--r--winit/Cargo.toml4
-rw-r--r--winit/src/conversion.rs17
4 files changed, 9 insertions, 19 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 1a4da1e3..5b1cfb0e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -93,9 +93,6 @@ iced_core = { version = "0.4", path = "core" }
iced_futures = { version = "0.3", path = "futures" }
thiserror = "1.0"
-[patch.crates-io]
-winit = { git = "https://github.com/iced-rs/winit", rev = "327c8756f90953a6a03f818113f8566176e6eb0d"}
-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
iced_winit = { version = "0.3", path = "winit" }
iced_glutin = { version = "0.2", path = "glutin", optional = true }
diff --git a/glutin/Cargo.toml b/glutin/Cargo.toml
index b42a6b36..b2a7f307 100644
--- a/glutin/Cargo.toml
+++ b/glutin/Cargo.toml
@@ -15,8 +15,8 @@ debug = ["iced_winit/debug"]
[dependencies.glutin]
version = "0.27"
-# git = "https://github.com/iced-rs/glutin"
-# rev = "2564d0ab87cf2ad824a2a58733aebe40dd2f29bb"
+git = "https://github.com/iced-rs/glutin"
+rev = "03437d8a1826d83c62017b2bb7bf18bfc9e352cc"
[dependencies.iced_native]
version = "0.4"
diff --git a/winit/Cargo.toml b/winit/Cargo.toml
index 87fd23d5..b1192135 100644
--- a/winit/Cargo.toml
+++ b/winit/Cargo.toml
@@ -20,8 +20,8 @@ thiserror = "1.0"
[dependencies.winit]
version = "0.25"
-# git = "https://github.com/iced-rs/winit"
-# rev = "e351421a32bf01b428325dde44dea39ee2656153"
+git = "https://github.com/iced-rs/winit"
+rev = "844485272a7412cb35cdbfac3524decdf59475ca"
[dependencies.iced_native]
version = "0.4"
diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs
index e61611aa..5a8b9fd8 100644
--- a/winit/src/conversion.rs
+++ b/winit/src/conversion.rs
@@ -218,17 +218,15 @@ pub fn menu<Message>(menu: &Menu<Message>) -> winit::window::Menu {
/// Given a [`Menu`] and an identifier of a [`menu::Entry`], it returns the
/// `Message` that should be produced when that entry is activated.
-pub fn menu_message<Message>(menu: &Menu<Message>, id: isize) -> Option<Message>
+pub fn menu_message<Message>(menu: &Menu<Message>, id: u32) -> Option<Message>
where
Message: Clone,
{
- use std::convert::TryFrom;
-
fn find_message<Message>(
- target: usize,
- starting_id: usize,
+ target: u32,
+ starting_id: u32,
menu: &Menu<Message>,
- ) -> Result<Message, usize>
+ ) -> Result<Message, u32>
where
Message: Clone,
{
@@ -260,12 +258,7 @@ where
Err(id - starting_id)
}
- // TODO: Does `winit` really need to provide an `isize`?
- if let Ok(id) = usize::try_from(id) {
- find_message(id, 0, menu).ok()
- } else {
- None
- }
+ find_message(id, 0, menu).ok()
}
/// Converts a `MouseCursor` from [`iced_native`] to a [`winit`] cursor icon.