1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-21 05:05:44 +02:00

remove unsafe cell from ws client

This commit is contained in:
Nikolay Kim
2018-06-19 09:36:17 +06:00
parent 261ad31b9a
commit 362b14c2f7
3 changed files with 9 additions and 10 deletions

View File

@@ -48,7 +48,6 @@ impl Extensions {
/// If a extension of this type existed, it will be returned.
pub fn remove<T: 'static>(&mut self) -> Option<T> {
self.map.remove(&TypeId::of::<T>()).and_then(|boxed| {
//TODO: we can use unsafe and remove double checking the type id
(boxed as Box<Any + 'static>)
.downcast()
.ok()