From 17e3353483da3a497b5137c613e50c60759381d3 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 17 Feb 2022 14:09:26 +0100 Subject: Make values sync --- src/util/mod.rs | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src/util/mod.rs') diff --git a/src/util/mod.rs b/src/util/mod.rs index 84bd1aa1..e42d0664 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -9,7 +9,6 @@ pub use eco_string::EcoString; pub use mac_roman::decode_mac_roman; pub use prehashed::Prehashed; -use std::cell::RefMut; use std::cmp::Ordering; use std::fmt::{self, Debug, Formatter}; use std::ops::Range; @@ -223,23 +222,3 @@ impl PathExt for Path { out } } - -/// Additional methods for [`RefMut`]. -pub trait RefMutExt<'a, T> { - fn try_map(orig: Self, f: F) -> Result, E> - where - F: FnOnce(&mut T) -> Result<&mut U, E>; -} - -impl<'a, T> RefMutExt<'a, T> for RefMut<'a, T> { - fn try_map(mut orig: Self, f: F) -> Result, E> - where - F: FnOnce(&mut T) -> Result<&mut U, E>, - { - // Taken from here: - // https://github.com/rust-lang/rust/issues/27746#issuecomment-172899746 - f(&mut orig) - .map(|new| new as *mut U) - .map(|raw| RefMut::map(orig, |_| unsafe { &mut *raw })) - } -} -- cgit v1.2.3