From 2538c87d3e8f67c1a7c4ef634bcd09a0c77b9879 Mon Sep 17 00:00:00 2001 From: fee1-dead Date: Fri, 17 Dec 2021 23:16:54 +0800 Subject: [PATCH] Remove outdated Rust compatibility code --- alacritty_terminal/src/event_loop.rs | 29 ---------------------------- 1 file changed, 29 deletions(-) diff --git a/alacritty_terminal/src/event_loop.rs b/alacritty_terminal/src/event_loop.rs index 4bf0965e..113efc1a 100644 --- a/alacritty_terminal/src/event_loop.rs +++ b/alacritty_terminal/src/event_loop.rs @@ -429,32 +429,3 @@ where }) } } - -trait OptionInsert { - type T; - fn insert(&mut self, value: Self::T) -> &mut Self::T; -} - -// TODO: Remove when MSRV is >= 1.53.0. -// -/// Trait implementation to support Rust version < 1.53.0. -/// -/// This is taken [from STD], further license information can be found in the [rust-lang/rust -/// repository]. -/// -/// -/// [from STD]: https://github.com/rust-lang/rust/blob/6e0b554619a3bb7e75b3334e97f191af20ef5d76/library/core/src/option.rs#L829-L858 -/// [rust-lang/rust repository]: https://github.com/rust-lang/rust/blob/master/LICENSE-MIT -impl OptionInsert for Option { - type T = T; - - fn insert(&mut self, value: T) -> &mut T { - *self = Some(value); - - match self { - Some(v) => v, - // SAFETY: the code above just filled the option - None => unsafe { std::hint::unreachable_unchecked() }, - } - } -}