mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-12-26 00:59:28 -05:00
Avoid warnings by adding explicit dyn
s in a few spots (#677)
This commit is contained in:
parent
26427db2a8
commit
4b7f57081a
2 changed files with 3 additions and 3 deletions
|
@ -415,14 +415,14 @@ impl Isolate {
|
|||
/// Get a reference to embedder data added with `set_slot()`.
|
||||
pub fn get_slot<T: 'static>(&self) -> Option<&T> {
|
||||
let b = self.get_annex().slots.get(&TypeId::of::<T>())?;
|
||||
let r = Any::downcast_ref::<T>(&**b).unwrap();
|
||||
let r = <dyn Any>::downcast_ref::<T>(&**b).unwrap();
|
||||
Some(r)
|
||||
}
|
||||
|
||||
/// Get a mutable reference to embedder data added with `set_slot()`.
|
||||
pub fn get_slot_mut<T: 'static>(&mut self) -> Option<&mut T> {
|
||||
let b = self.get_annex_mut().slots.get_mut(&TypeId::of::<T>())?;
|
||||
let r = Any::downcast_mut::<T>(&mut **b).unwrap();
|
||||
let r = <dyn Any>::downcast_mut::<T>(&mut **b).unwrap();
|
||||
Some(r)
|
||||
}
|
||||
|
||||
|
|
|
@ -408,7 +408,7 @@ impl<T: ?Sized + 'static> Allocation<T> {
|
|||
value: Abstract,
|
||||
wrap: fn(Concrete) -> Self,
|
||||
) -> Result<Self, Abstract> {
|
||||
if Any::is::<Concrete>(&value) {
|
||||
if <dyn Any>::is::<Concrete>(&value) {
|
||||
Ok(unsafe { Self::transmute_wrap(value, wrap) })
|
||||
} else {
|
||||
Err(value)
|
||||
|
|
Loading…
Reference in a new issue