Replaced ref_slice::ref_slice with std::slice::from_ref

ref_slice::ref_slice is deprecated in ref_slice-1.2.1,
because it's redundant with std since rust 1.28.

Signed-off-by: Adrian Willenbücher <willenbuecher@xq-tec.com>
This commit is contained in:
Adrian Willenbücher 2021-06-10 20:56:41 +02:00
parent b80b3ea02c
commit 0917dc4e87
4 changed files with 7 additions and 15 deletions

View file

@ -85,7 +85,6 @@ phf = "0.8"
pixels = { path = "../pixels" }
profile_traits = { path = "../profile_traits" }
ref_filter_map = "1.0.1"
ref_slice = "1.0"
regex = "1.1"
script_layout_interface = { path = "../script_layout_interface" }
script_plugins = { path = "../script_plugins" }

View file

@ -140,7 +140,6 @@ use num_traits::ToPrimitive;
use percent_encoding::percent_decode;
use profile_traits::ipc as profile_ipc;
use profile_traits::time::{TimerMetadata, TimerMetadataFrameType, TimerMetadataReflowType};
use ref_slice::ref_slice;
use script_layout_interface::message::{Msg, PendingRestyle, ReflowGoal};
use script_layout_interface::TrustedNodeAddress;
use script_traits::{AnimationState, DocumentActivity, MouseButton, MouseEventType};
@ -161,6 +160,7 @@ use std::default::Default;
use std::mem;
use std::ptr::NonNull;
use std::rc::Rc;
use std::slice::from_ref;
use std::time::{Duration, Instant};
use style::attr::AttrValue;
use style::context::QuirksMode;
@ -1708,7 +1708,7 @@ impl Document {
Some(window),
0i32,
&touches,
&TouchList::new(window, ref_slice(&&*touch)),
&TouchList::new(window, from_ref(&&*touch)),
&TouchList::new(window, target_touches.r()),
// FIXME: modifier keys
false,

View file

@ -74,7 +74,6 @@ use libc::{self, c_void, uintptr_t};
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use net_traits::image::base::{Image, ImageMetadata};
use ref_slice::ref_slice;
use script_layout_interface::message::QueryMsg;
use script_layout_interface::{HTMLCanvasData, HTMLMediaData, LayoutElementType, LayoutNodeType};
use script_layout_interface::{SVGSVGData, StyleAndOpaqueLayoutData, TrustedNodeAddress};
@ -93,6 +92,7 @@ use std::default::Default;
use std::iter;
use std::mem;
use std::ops::Range;
use std::slice::from_ref;
use std::sync::Arc as StdArc;
use style::context::QuirksMode;
use style::dom::OpaqueNode;
@ -2061,7 +2061,7 @@ impl Node {
new_nodes.r()
} else {
// Step 3.
ref_slice(&node)
from_ref(&node)
};
// Step 6.
let previous_sibling = match suppress_observers {
@ -2130,7 +2130,7 @@ impl Node {
added_nodes.extend(node.children().map(|child| Dom::from_ref(&*child)));
added_nodes.r()
} else {
ref_slice(node)
from_ref(node)
}
} else {
&[] as &[&Node]
@ -2750,7 +2750,7 @@ impl NodeMethods for Node {
nodes.extend(node.children().map(|node| Dom::from_ref(&*node)));
nodes.r()
} else {
ref_slice(&node)
from_ref(&node)
};
// Step 13.
@ -3273,7 +3273,7 @@ impl<'a> ChildrenMutation<'a> {
if let Some(ref removed) = *removed {
if let (None, None) = (prev, next) {
ChildrenMutation::ReplaceAll {
removed: ref_slice(removed),
removed: from_ref(removed),
added: added,
}
} else {