mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
cargo-fix for 2021
This commit is contained in:
parent
c2778b9bef
commit
dffb75a4c6
12 changed files with 69 additions and 69 deletions
|
@ -54,7 +54,7 @@ pub struct RootTypeDef {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Parse for MacroInput {
|
impl Parse for MacroInput {
|
||||||
fn parse(input: ParseStream) -> Result<Self> {
|
fn parse(input: ParseStream<'_>) -> Result<Self> {
|
||||||
let fields: Punctuated<MacroArg, Token![, ]> = input.parse_terminated(MacroArg::parse)?;
|
let fields: Punctuated<MacroArg, Token![, ]> = input.parse_terminated(MacroArg::parse)?;
|
||||||
let mut gen_accessors = None;
|
let mut gen_accessors = None;
|
||||||
let mut type_def = None;
|
let mut type_def = None;
|
||||||
|
@ -83,7 +83,7 @@ impl Parse for MacroInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Parse for MacroArg {
|
impl Parse for MacroArg {
|
||||||
fn parse(input: ParseStream) -> Result<Self> {
|
fn parse(input: ParseStream<'_>) -> Result<Self> {
|
||||||
let lookahead = input.lookahead1();
|
let lookahead = input.lookahead1();
|
||||||
if lookahead.peek(kw::gen_types) {
|
if lookahead.peek(kw::gen_types) {
|
||||||
Ok(MacroArg::Types(input.parse()?))
|
Ok(MacroArg::Types(input.parse()?))
|
||||||
|
@ -98,7 +98,7 @@ impl Parse for MacroArg {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<K: Parse, V: Parse> Parse for ArgInner<K, V> {
|
impl<K: Parse, V: Parse> Parse for ArgInner<K, V> {
|
||||||
fn parse(input: ParseStream) -> Result<Self> {
|
fn parse(input: ParseStream<'_>) -> Result<Self> {
|
||||||
Ok(ArgInner {
|
Ok(ArgInner {
|
||||||
_field_kw: input.parse()?,
|
_field_kw: input.parse()?,
|
||||||
_equals: input.parse()?,
|
_equals: input.parse()?,
|
||||||
|
@ -108,7 +108,7 @@ impl<K: Parse, V: Parse> Parse for ArgInner<K, V> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Parse for Field {
|
impl Parse for Field {
|
||||||
fn parse(input: ParseStream) -> Result<Self> {
|
fn parse(input: ParseStream<'_>) -> Result<Self> {
|
||||||
Ok(Field {
|
Ok(Field {
|
||||||
attributes: input.call(Attribute::parse_outer)?,
|
attributes: input.call(Attribute::parse_outer)?,
|
||||||
name: input.parse()?,
|
name: input.parse()?,
|
||||||
|
@ -119,7 +119,7 @@ impl Parse for Field {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Parse for RootTypeDef {
|
impl Parse for RootTypeDef {
|
||||||
fn parse(input: ParseStream) -> Result<Self> {
|
fn parse(input: ParseStream<'_>) -> Result<Self> {
|
||||||
Ok(RootTypeDef {
|
Ok(RootTypeDef {
|
||||||
type_name: input.parse()?,
|
type_name: input.parse()?,
|
||||||
type_def: input.parse()?,
|
type_def: input.parse()?,
|
||||||
|
@ -128,7 +128,7 @@ impl Parse for RootTypeDef {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Parse for NewTypeDef {
|
impl Parse for NewTypeDef {
|
||||||
fn parse(input: ParseStream) -> Result<Self> {
|
fn parse(input: ParseStream<'_>) -> Result<Self> {
|
||||||
let content;
|
let content;
|
||||||
#[allow(clippy::eval_order_dependence)]
|
#[allow(clippy::eval_order_dependence)]
|
||||||
Ok(NewTypeDef {
|
Ok(NewTypeDef {
|
||||||
|
@ -139,7 +139,7 @@ impl Parse for NewTypeDef {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Parse for FieldType {
|
impl Parse for FieldType {
|
||||||
fn parse(input: ParseStream) -> Result<Self> {
|
fn parse(input: ParseStream<'_>) -> Result<Self> {
|
||||||
if input.peek(token::Brace) {
|
if input.peek(token::Brace) {
|
||||||
Ok(FieldType::NewTypeDef(input.parse()?))
|
Ok(FieldType::NewTypeDef(input.parse()?))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -75,7 +75,7 @@ where
|
||||||
Ok(self.shrink_to_fit())
|
Ok(self.shrink_to_fit())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn try_entry(&mut self, key: K) -> Result<Entry<K, V>, FailedAllocationError> {
|
pub fn try_entry(&mut self, key: K) -> Result<Entry<'_, K, V>, FailedAllocationError> {
|
||||||
Ok(self.entry(key))
|
Ok(self.entry(key))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ where
|
||||||
V: fmt::Debug,
|
V: fmt::Debug,
|
||||||
S: BuildHasher,
|
S: BuildHasher,
|
||||||
{
|
{
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
self.0.fmt(f)
|
self.0.fmt(f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,7 @@ where
|
||||||
T: Eq + Hash + fmt::Debug,
|
T: Eq + Hash + fmt::Debug,
|
||||||
S: BuildHasher,
|
S: BuildHasher,
|
||||||
{
|
{
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
self.0.fmt(f)
|
self.0.fmt(f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -452,7 +452,7 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pop_internal<K, V>(starting_bucket: FullBucketMut<K, V>) -> (K, V, &mut RawTable<K, V>) {
|
fn pop_internal<K, V>(starting_bucket: FullBucketMut<'_, K, V>) -> (K, V, &mut RawTable<K, V>) {
|
||||||
let (empty, retkey, retval) = starting_bucket.take();
|
let (empty, retkey, retval) = starting_bucket.take();
|
||||||
let mut gap = match empty.gap_peek() {
|
let mut gap = match empty.gap_peek() {
|
||||||
Ok(b) => b,
|
Ok(b) => b,
|
||||||
|
@ -856,7 +856,7 @@ where
|
||||||
/// println!("{}", key);
|
/// println!("{}", key);
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
pub fn keys(&self) -> Keys<K, V> {
|
pub fn keys(&self) -> Keys<'_, K, V> {
|
||||||
Keys { inner: self.iter() }
|
Keys { inner: self.iter() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -877,7 +877,7 @@ where
|
||||||
/// println!("{}", val);
|
/// println!("{}", val);
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
pub fn values(&self) -> Values<K, V> {
|
pub fn values(&self) -> Values<'_, K, V> {
|
||||||
Values { inner: self.iter() }
|
Values { inner: self.iter() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -903,7 +903,7 @@ where
|
||||||
/// println!("{}", val);
|
/// println!("{}", val);
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
pub fn values_mut(&mut self) -> ValuesMut<K, V> {
|
pub fn values_mut(&mut self) -> ValuesMut<'_, K, V> {
|
||||||
ValuesMut {
|
ValuesMut {
|
||||||
inner: self.iter_mut(),
|
inner: self.iter_mut(),
|
||||||
}
|
}
|
||||||
|
@ -926,7 +926,7 @@ where
|
||||||
/// println!("key: {} val: {}", key, val);
|
/// println!("key: {} val: {}", key, val);
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
pub fn iter(&self) -> Iter<K, V> {
|
pub fn iter(&self) -> Iter<'_, K, V> {
|
||||||
Iter {
|
Iter {
|
||||||
inner: self.table.iter(),
|
inner: self.table.iter(),
|
||||||
}
|
}
|
||||||
|
@ -955,7 +955,7 @@ where
|
||||||
/// println!("key: {} val: {}", key, val);
|
/// println!("key: {} val: {}", key, val);
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
pub fn iter_mut(&mut self) -> IterMut<K, V> {
|
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> {
|
||||||
IterMut {
|
IterMut {
|
||||||
inner: self.table.iter_mut(),
|
inner: self.table.iter_mut(),
|
||||||
}
|
}
|
||||||
|
@ -980,12 +980,12 @@ where
|
||||||
/// assert_eq!(letters[&'u'], 1);
|
/// assert_eq!(letters[&'u'], 1);
|
||||||
/// assert_eq!(letters.get(&'y'), None);
|
/// assert_eq!(letters.get(&'y'), None);
|
||||||
/// ```
|
/// ```
|
||||||
pub fn entry(&mut self, key: K) -> Entry<K, V> {
|
pub fn entry(&mut self, key: K) -> Entry<'_, K, V> {
|
||||||
self.try_entry(key).unwrap()
|
self.try_entry(key).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn try_entry(&mut self, key: K) -> Result<Entry<K, V>, FailedAllocationError> {
|
pub fn try_entry(&mut self, key: K) -> Result<Entry<'_, K, V>, FailedAllocationError> {
|
||||||
// Gotta resize now.
|
// Gotta resize now.
|
||||||
self.try_reserve(1)?;
|
self.try_reserve(1)?;
|
||||||
let hash = self.make_hash(&key);
|
let hash = self.make_hash(&key);
|
||||||
|
@ -1047,7 +1047,7 @@ where
|
||||||
/// assert!(a.is_empty());
|
/// assert!(a.is_empty());
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn drain(&mut self) -> Drain<K, V>
|
pub fn drain(&mut self) -> Drain<'_, K, V>
|
||||||
where
|
where
|
||||||
K: 'static,
|
K: 'static,
|
||||||
V: 'static,
|
V: 'static,
|
||||||
|
@ -1314,7 +1314,7 @@ where
|
||||||
V: Debug,
|
V: Debug,
|
||||||
S: BuildHasher,
|
S: BuildHasher,
|
||||||
{
|
{
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_map().entries(self.iter()).finish()
|
f.debug_map().entries(self.iter()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1351,7 +1351,7 @@ where
|
||||||
///
|
///
|
||||||
/// [`iter`]: struct.HashMap.html#method.iter
|
/// [`iter`]: struct.HashMap.html#method.iter
|
||||||
/// [`HashMap`]: struct.HashMap.html
|
/// [`HashMap`]: struct.HashMap.html
|
||||||
pub struct Iter<'a, K: 'a, V: 'a> {
|
pub struct Iter<'a, K, V> {
|
||||||
inner: table::Iter<'a, K, V>,
|
inner: table::Iter<'a, K, V>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1365,7 +1365,7 @@ impl<'a, K, V> Clone for Iter<'a, K, V> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, K: Debug, V: Debug> fmt::Debug for Iter<'a, K, V> {
|
impl<'a, K: Debug, V: Debug> fmt::Debug for Iter<'a, K, V> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_list().entries(self.clone()).finish()
|
f.debug_list().entries(self.clone()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1377,7 +1377,7 @@ impl<'a, K: Debug, V: Debug> fmt::Debug for Iter<'a, K, V> {
|
||||||
///
|
///
|
||||||
/// [`iter_mut`]: struct.HashMap.html#method.iter_mut
|
/// [`iter_mut`]: struct.HashMap.html#method.iter_mut
|
||||||
/// [`HashMap`]: struct.HashMap.html
|
/// [`HashMap`]: struct.HashMap.html
|
||||||
pub struct IterMut<'a, K: 'a, V: 'a> {
|
pub struct IterMut<'a, K, V> {
|
||||||
inner: table::IterMut<'a, K, V>,
|
inner: table::IterMut<'a, K, V>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1399,7 +1399,7 @@ pub struct IntoIter<K, V> {
|
||||||
///
|
///
|
||||||
/// [`keys`]: struct.HashMap.html#method.keys
|
/// [`keys`]: struct.HashMap.html#method.keys
|
||||||
/// [`HashMap`]: struct.HashMap.html
|
/// [`HashMap`]: struct.HashMap.html
|
||||||
pub struct Keys<'a, K: 'a, V: 'a> {
|
pub struct Keys<'a, K, V> {
|
||||||
inner: Iter<'a, K, V>,
|
inner: Iter<'a, K, V>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1413,7 +1413,7 @@ impl<'a, K, V> Clone for Keys<'a, K, V> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, K: Debug, V> fmt::Debug for Keys<'a, K, V> {
|
impl<'a, K: Debug, V> fmt::Debug for Keys<'a, K, V> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_list().entries(self.clone()).finish()
|
f.debug_list().entries(self.clone()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1425,7 +1425,7 @@ impl<'a, K: Debug, V> fmt::Debug for Keys<'a, K, V> {
|
||||||
///
|
///
|
||||||
/// [`values`]: struct.HashMap.html#method.values
|
/// [`values`]: struct.HashMap.html#method.values
|
||||||
/// [`HashMap`]: struct.HashMap.html
|
/// [`HashMap`]: struct.HashMap.html
|
||||||
pub struct Values<'a, K: 'a, V: 'a> {
|
pub struct Values<'a, K, V> {
|
||||||
inner: Iter<'a, K, V>,
|
inner: Iter<'a, K, V>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1439,7 +1439,7 @@ impl<'a, K, V> Clone for Values<'a, K, V> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, K, V: Debug> fmt::Debug for Values<'a, K, V> {
|
impl<'a, K, V: Debug> fmt::Debug for Values<'a, K, V> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_list().entries(self.clone()).finish()
|
f.debug_list().entries(self.clone()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1462,7 +1462,7 @@ pub struct Drain<'a, K: 'static, V: 'static> {
|
||||||
///
|
///
|
||||||
/// [`values_mut`]: struct.HashMap.html#method.values_mut
|
/// [`values_mut`]: struct.HashMap.html#method.values_mut
|
||||||
/// [`HashMap`]: struct.HashMap.html
|
/// [`HashMap`]: struct.HashMap.html
|
||||||
pub struct ValuesMut<'a, K: 'a, V: 'a> {
|
pub struct ValuesMut<'a, K, V> {
|
||||||
inner: IterMut<'a, K, V>,
|
inner: IterMut<'a, K, V>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1507,7 +1507,7 @@ impl<'a, K, V> InternalEntry<K, V, &'a mut RawTable<K, V>> {
|
||||||
///
|
///
|
||||||
/// [`HashMap`]: struct.HashMap.html
|
/// [`HashMap`]: struct.HashMap.html
|
||||||
/// [`entry`]: struct.HashMap.html#method.entry
|
/// [`entry`]: struct.HashMap.html#method.entry
|
||||||
pub enum Entry<'a, K: 'a, V: 'a> {
|
pub enum Entry<'a, K, V> {
|
||||||
/// An occupied entry.
|
/// An occupied entry.
|
||||||
Occupied(OccupiedEntry<'a, K, V>),
|
Occupied(OccupiedEntry<'a, K, V>),
|
||||||
|
|
||||||
|
@ -1516,7 +1516,7 @@ pub enum Entry<'a, K: 'a, V: 'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, K: 'a + Debug, V: 'a + Debug> Debug for Entry<'a, K, V> {
|
impl<'a, K: 'a + Debug, V: 'a + Debug> Debug for Entry<'a, K, V> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
match *self {
|
match *self {
|
||||||
Vacant(ref v) => f.debug_tuple("Entry").field(v).finish(),
|
Vacant(ref v) => f.debug_tuple("Entry").field(v).finish(),
|
||||||
Occupied(ref o) => f.debug_tuple("Entry").field(o).finish(),
|
Occupied(ref o) => f.debug_tuple("Entry").field(o).finish(),
|
||||||
|
@ -1528,13 +1528,13 @@ impl<'a, K: 'a + Debug, V: 'a + Debug> Debug for Entry<'a, K, V> {
|
||||||
/// It is part of the [`Entry`] enum.
|
/// It is part of the [`Entry`] enum.
|
||||||
///
|
///
|
||||||
/// [`Entry`]: enum.Entry.html
|
/// [`Entry`]: enum.Entry.html
|
||||||
pub struct OccupiedEntry<'a, K: 'a, V: 'a> {
|
pub struct OccupiedEntry<'a, K, V> {
|
||||||
key: Option<K>,
|
key: Option<K>,
|
||||||
elem: FullBucket<K, V, &'a mut RawTable<K, V>>,
|
elem: FullBucket<K, V, &'a mut RawTable<K, V>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, K: 'a + Debug, V: 'a + Debug> Debug for OccupiedEntry<'a, K, V> {
|
impl<'a, K: 'a + Debug, V: 'a + Debug> Debug for OccupiedEntry<'a, K, V> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_struct("OccupiedEntry")
|
f.debug_struct("OccupiedEntry")
|
||||||
.field("key", self.key())
|
.field("key", self.key())
|
||||||
.field("value", self.get())
|
.field("value", self.get())
|
||||||
|
@ -1546,14 +1546,14 @@ impl<'a, K: 'a + Debug, V: 'a + Debug> Debug for OccupiedEntry<'a, K, V> {
|
||||||
/// It is part of the [`Entry`] enum.
|
/// It is part of the [`Entry`] enum.
|
||||||
///
|
///
|
||||||
/// [`Entry`]: enum.Entry.html
|
/// [`Entry`]: enum.Entry.html
|
||||||
pub struct VacantEntry<'a, K: 'a, V: 'a> {
|
pub struct VacantEntry<'a, K, V> {
|
||||||
hash: SafeHash,
|
hash: SafeHash,
|
||||||
key: K,
|
key: K,
|
||||||
elem: VacantEntryState<K, V, &'a mut RawTable<K, V>>,
|
elem: VacantEntryState<K, V, &'a mut RawTable<K, V>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, K: 'a + Debug, V: 'a> Debug for VacantEntry<'a, K, V> {
|
impl<'a, K: 'a + Debug, V: 'a> Debug for VacantEntry<'a, K, V> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_tuple("VacantEntry").field(self.key()).finish()
|
f.debug_tuple("VacantEntry").field(self.key()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1668,7 +1668,7 @@ where
|
||||||
K: fmt::Debug,
|
K: fmt::Debug,
|
||||||
V: fmt::Debug,
|
V: fmt::Debug,
|
||||||
{
|
{
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_list().entries(self.inner.iter()).finish()
|
f.debug_list().entries(self.inner.iter()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1693,7 +1693,7 @@ impl<K, V> ExactSizeIterator for IntoIter<K, V> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<K: Debug, V: Debug> fmt::Debug for IntoIter<K, V> {
|
impl<K: Debug, V: Debug> fmt::Debug for IntoIter<K, V> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_list().entries(self.inner.iter()).finish()
|
f.debug_list().entries(self.inner.iter()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1759,7 +1759,7 @@ where
|
||||||
K: fmt::Debug,
|
K: fmt::Debug,
|
||||||
V: fmt::Debug,
|
V: fmt::Debug,
|
||||||
{
|
{
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_list().entries(self.inner.inner.iter()).finish()
|
f.debug_list().entries(self.inner.inner.iter()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1788,7 +1788,7 @@ where
|
||||||
K: fmt::Debug,
|
K: fmt::Debug,
|
||||||
V: fmt::Debug,
|
V: fmt::Debug,
|
||||||
{
|
{
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_list().entries(self.inner.iter()).finish()
|
f.debug_list().entries(self.inner.iter()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,7 +271,7 @@ where
|
||||||
/// println!("{}", x);
|
/// println!("{}", x);
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
pub fn iter(&self) -> Iter<T> {
|
pub fn iter(&self) -> Iter<'_, T> {
|
||||||
Iter {
|
Iter {
|
||||||
iter: self.map.keys(),
|
iter: self.map.keys(),
|
||||||
}
|
}
|
||||||
|
@ -436,7 +436,7 @@ where
|
||||||
/// assert!(set.is_empty());
|
/// assert!(set.is_empty());
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn drain(&mut self) -> Drain<T> {
|
pub fn drain(&mut self) -> Drain<'_, T> {
|
||||||
Drain {
|
Drain {
|
||||||
iter: self.map.drain(),
|
iter: self.map.drain(),
|
||||||
}
|
}
|
||||||
|
@ -696,7 +696,7 @@ where
|
||||||
T: Eq + Hash + fmt::Debug,
|
T: Eq + Hash + fmt::Debug,
|
||||||
S: BuildHasher,
|
S: BuildHasher,
|
||||||
{
|
{
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_set().entries(self.iter()).finish()
|
f.debug_set().entries(self.iter()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -881,7 +881,7 @@ where
|
||||||
///
|
///
|
||||||
/// [`HashSet`]: struct.HashSet.html
|
/// [`HashSet`]: struct.HashSet.html
|
||||||
/// [`iter`]: struct.HashSet.html#method.iter
|
/// [`iter`]: struct.HashSet.html#method.iter
|
||||||
pub struct Iter<'a, K: 'a> {
|
pub struct Iter<'a, K> {
|
||||||
iter: Keys<'a, K, ()>,
|
iter: Keys<'a, K, ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -914,7 +914,7 @@ pub struct Drain<'a, K: 'static> {
|
||||||
///
|
///
|
||||||
/// [`HashSet`]: struct.HashSet.html
|
/// [`HashSet`]: struct.HashSet.html
|
||||||
/// [`intersection`]: struct.HashSet.html#method.intersection
|
/// [`intersection`]: struct.HashSet.html#method.intersection
|
||||||
pub struct Intersection<'a, T: 'a, S: 'a> {
|
pub struct Intersection<'a, T, S> {
|
||||||
// iterator of the first set
|
// iterator of the first set
|
||||||
iter: Iter<'a, T>,
|
iter: Iter<'a, T>,
|
||||||
// the second set
|
// the second set
|
||||||
|
@ -928,7 +928,7 @@ pub struct Intersection<'a, T: 'a, S: 'a> {
|
||||||
///
|
///
|
||||||
/// [`HashSet`]: struct.HashSet.html
|
/// [`HashSet`]: struct.HashSet.html
|
||||||
/// [`difference`]: struct.HashSet.html#method.difference
|
/// [`difference`]: struct.HashSet.html#method.difference
|
||||||
pub struct Difference<'a, T: 'a, S: 'a> {
|
pub struct Difference<'a, T, S> {
|
||||||
// iterator of the first set
|
// iterator of the first set
|
||||||
iter: Iter<'a, T>,
|
iter: Iter<'a, T>,
|
||||||
// the second set
|
// the second set
|
||||||
|
@ -942,7 +942,7 @@ pub struct Difference<'a, T: 'a, S: 'a> {
|
||||||
///
|
///
|
||||||
/// [`HashSet`]: struct.HashSet.html
|
/// [`HashSet`]: struct.HashSet.html
|
||||||
/// [`symmetric_difference`]: struct.HashSet.html#method.symmetric_difference
|
/// [`symmetric_difference`]: struct.HashSet.html#method.symmetric_difference
|
||||||
pub struct SymmetricDifference<'a, T: 'a, S: 'a> {
|
pub struct SymmetricDifference<'a, T, S> {
|
||||||
iter: Chain<Difference<'a, T, S>, Difference<'a, T, S>>,
|
iter: Chain<Difference<'a, T, S>, Difference<'a, T, S>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -953,7 +953,7 @@ pub struct SymmetricDifference<'a, T: 'a, S: 'a> {
|
||||||
///
|
///
|
||||||
/// [`HashSet`]: struct.HashSet.html
|
/// [`HashSet`]: struct.HashSet.html
|
||||||
/// [`union`]: struct.HashSet.html#method.union
|
/// [`union`]: struct.HashSet.html#method.union
|
||||||
pub struct Union<'a, T: 'a, S: 'a> {
|
pub struct Union<'a, T, S> {
|
||||||
iter: Chain<Iter<'a, T>, Difference<'a, T, S>>,
|
iter: Chain<Iter<'a, T>, Difference<'a, T, S>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1029,7 +1029,7 @@ impl<'a, K> ExactSizeIterator for Iter<'a, K> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, K: fmt::Debug> fmt::Debug for Iter<'a, K> {
|
impl<'a, K: fmt::Debug> fmt::Debug for Iter<'a, K> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_list().entries(self.clone()).finish()
|
f.debug_list().entries(self.clone()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1051,7 +1051,7 @@ impl<K> ExactSizeIterator for IntoIter<K> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<K: fmt::Debug> fmt::Debug for IntoIter<K> {
|
impl<K: fmt::Debug> fmt::Debug for IntoIter<K> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
let entries_iter = self.iter.inner.iter().map(|(k, _)| k);
|
let entries_iter = self.iter.inner.iter().map(|(k, _)| k);
|
||||||
f.debug_list().entries(entries_iter).finish()
|
f.debug_list().entries(entries_iter).finish()
|
||||||
}
|
}
|
||||||
|
@ -1074,7 +1074,7 @@ impl<'a, K> ExactSizeIterator for Drain<'a, K> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, K: fmt::Debug> fmt::Debug for Drain<'a, K> {
|
impl<'a, K: fmt::Debug> fmt::Debug for Drain<'a, K> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
let entries_iter = self.iter.inner.iter().map(|(k, _)| k);
|
let entries_iter = self.iter.inner.iter().map(|(k, _)| k);
|
||||||
f.debug_list().entries(entries_iter).finish()
|
f.debug_list().entries(entries_iter).finish()
|
||||||
}
|
}
|
||||||
|
@ -1116,7 +1116,7 @@ where
|
||||||
T: fmt::Debug + Eq + Hash,
|
T: fmt::Debug + Eq + Hash,
|
||||||
S: BuildHasher,
|
S: BuildHasher,
|
||||||
{
|
{
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_list().entries(self.clone()).finish()
|
f.debug_list().entries(self.clone()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1157,7 +1157,7 @@ where
|
||||||
T: fmt::Debug + Eq + Hash,
|
T: fmt::Debug + Eq + Hash,
|
||||||
S: BuildHasher,
|
S: BuildHasher,
|
||||||
{
|
{
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_list().entries(self.clone()).finish()
|
f.debug_list().entries(self.clone()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1190,7 +1190,7 @@ where
|
||||||
T: fmt::Debug + Eq + Hash,
|
T: fmt::Debug + Eq + Hash,
|
||||||
S: BuildHasher,
|
S: BuildHasher,
|
||||||
{
|
{
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_list().entries(self.clone()).finish()
|
f.debug_list().entries(self.clone()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1208,7 +1208,7 @@ where
|
||||||
T: fmt::Debug + Eq + Hash,
|
T: fmt::Debug + Eq + Hash,
|
||||||
S: BuildHasher,
|
S: BuildHasher,
|
||||||
{
|
{
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_list().entries(self.clone()).finish()
|
f.debug_list().entries(self.clone()).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ impl error::Error for FailedAllocationError {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for FailedAllocationError {
|
impl fmt::Display for FailedAllocationError {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
match self.allocation_info {
|
match self.allocation_info {
|
||||||
Some(ref info) => write!(
|
Some(ref info) => write!(
|
||||||
f,
|
f,
|
||||||
|
|
|
@ -853,7 +853,7 @@ impl<K, V> RawTable<K, V> {
|
||||||
self.size
|
self.size
|
||||||
}
|
}
|
||||||
|
|
||||||
fn raw_buckets(&self) -> RawBuckets<K, V> {
|
fn raw_buckets(&self) -> RawBuckets<'_, K, V> {
|
||||||
RawBuckets {
|
RawBuckets {
|
||||||
raw: self.raw_bucket_at(0),
|
raw: self.raw_bucket_at(0),
|
||||||
elems_left: self.size,
|
elems_left: self.size,
|
||||||
|
@ -861,13 +861,13 @@ impl<K, V> RawTable<K, V> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn iter(&self) -> Iter<K, V> {
|
pub fn iter(&self) -> Iter<'_, K, V> {
|
||||||
Iter {
|
Iter {
|
||||||
iter: self.raw_buckets(),
|
iter: self.raw_buckets(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn iter_mut(&mut self) -> IterMut<K, V> {
|
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> {
|
||||||
IterMut {
|
IterMut {
|
||||||
iter: self.raw_buckets(),
|
iter: self.raw_buckets(),
|
||||||
_marker: marker::PhantomData,
|
_marker: marker::PhantomData,
|
||||||
|
@ -889,7 +889,7 @@ impl<K, V> RawTable<K, V> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn drain(&mut self) -> Drain<K, V> {
|
pub fn drain(&mut self) -> Drain<'_, K, V> {
|
||||||
let RawBuckets {
|
let RawBuckets {
|
||||||
raw, elems_left, ..
|
raw, elems_left, ..
|
||||||
} = self.raw_buckets();
|
} = self.raw_buckets();
|
||||||
|
@ -1008,7 +1008,7 @@ impl<'a, K, V> Clone for Iter<'a, K, V> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Iterator over mutable references to entries in a table.
|
/// Iterator over mutable references to entries in a table.
|
||||||
pub struct IterMut<'a, K: 'a, V: 'a> {
|
pub struct IterMut<'a, K: 'a, V> {
|
||||||
iter: RawBuckets<'a, K, V>,
|
iter: RawBuckets<'a, K, V>,
|
||||||
// To ensure invariance with respect to V
|
// To ensure invariance with respect to V
|
||||||
_marker: marker::PhantomData<&'a mut V>,
|
_marker: marker::PhantomData<&'a mut V>,
|
||||||
|
@ -1020,7 +1020,7 @@ unsafe impl<'a, K: Sync, V: Sync> Sync for IterMut<'a, K, V> {}
|
||||||
unsafe impl<'a, K: Send, V: Send> Send for IterMut<'a, K, V> {}
|
unsafe impl<'a, K: Send, V: Send> Send for IterMut<'a, K, V> {}
|
||||||
|
|
||||||
impl<'a, K: 'a, V: 'a> IterMut<'a, K, V> {
|
impl<'a, K: 'a, V: 'a> IterMut<'a, K, V> {
|
||||||
pub fn iter(&self) -> Iter<K, V> {
|
pub fn iter(&self) -> Iter<'_, K, V> {
|
||||||
Iter {
|
Iter {
|
||||||
iter: self.iter.clone(),
|
iter: self.iter.clone(),
|
||||||
}
|
}
|
||||||
|
@ -1037,7 +1037,7 @@ unsafe impl<K: Sync, V: Sync> Sync for IntoIter<K, V> {}
|
||||||
unsafe impl<K: Send, V: Send> Send for IntoIter<K, V> {}
|
unsafe impl<K: Send, V: Send> Send for IntoIter<K, V> {}
|
||||||
|
|
||||||
impl<K, V> IntoIter<K, V> {
|
impl<K, V> IntoIter<K, V> {
|
||||||
pub fn iter(&self) -> Iter<K, V> {
|
pub fn iter(&self) -> Iter<'_, K, V> {
|
||||||
Iter {
|
Iter {
|
||||||
iter: self.iter.clone(),
|
iter: self.iter.clone(),
|
||||||
}
|
}
|
||||||
|
@ -1055,7 +1055,7 @@ unsafe impl<'a, K: Sync, V: Sync> Sync for Drain<'a, K, V> {}
|
||||||
unsafe impl<'a, K: Send, V: Send> Send for Drain<'a, K, V> {}
|
unsafe impl<'a, K: Send, V: Send> Send for Drain<'a, K, V> {}
|
||||||
|
|
||||||
impl<'a, K, V> Drain<'a, K, V> {
|
impl<'a, K, V> Drain<'a, K, V> {
|
||||||
pub fn iter(&self) -> Iter<K, V> {
|
pub fn iter(&self) -> Iter<'_, K, V> {
|
||||||
Iter {
|
Iter {
|
||||||
iter: self.iter.clone(),
|
iter: self.iter.clone(),
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ impl App {
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function decides whether the event should be handled during `run_forever`.
|
// This function decides whether the event should be handled during `run_forever`.
|
||||||
fn winit_event_to_servo_event(&self, event: winit::event::Event<ServoEvent>) {
|
fn winit_event_to_servo_event(&self, event: winit::event::Event<'_, ServoEvent>) {
|
||||||
match event {
|
match event {
|
||||||
// App level events
|
// App level events
|
||||||
winit::event::Event::Suspended => {
|
winit::event::Event::Suspended => {
|
||||||
|
|
|
@ -28,7 +28,7 @@ struct Print {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for Print {
|
impl fmt::Debug for Print {
|
||||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
// Safety: we’re in a signal handler that is about to call `libc::_exit`.
|
// Safety: we’re in a signal handler that is about to call `libc::_exit`.
|
||||||
// Potential data races from using `*_unsynchronized` functions are perhaps
|
// Potential data races from using `*_unsynchronized` functions are perhaps
|
||||||
// less bad than potential deadlocks?
|
// less bad than potential deadlocks?
|
||||||
|
@ -78,7 +78,7 @@ impl fmt::Debug for Print {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_path(fmt: &mut fmt::Formatter, path: BytesOrWideString) -> fmt::Result {
|
fn print_path(fmt: &mut fmt::Formatter<'_>, path: BytesOrWideString<'_>) -> fmt::Result {
|
||||||
match path {
|
match path {
|
||||||
BytesOrWideString::Bytes(mut bytes) => loop {
|
BytesOrWideString::Bytes(mut bytes) => loop {
|
||||||
match std::str::from_utf8(bytes) {
|
match std::str::from_utf8(bytes) {
|
||||||
|
|
|
@ -82,7 +82,7 @@ impl EventsLoop {
|
||||||
|
|
||||||
pub fn run_forever<F: 'static>(self, mut callback: F)
|
pub fn run_forever<F: 'static>(self, mut callback: F)
|
||||||
where F: FnMut(
|
where F: FnMut(
|
||||||
winit::event::Event<ServoEvent>,
|
winit::event::Event<'_, ServoEvent>,
|
||||||
Option<&winit::event_loop::EventLoopWindowTarget<ServoEvent>>,
|
Option<&winit::event_loop::EventLoopWindowTarget<ServoEvent>>,
|
||||||
&mut winit::event_loop::ControlFlow
|
&mut winit::event_loop::ControlFlow
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -394,7 +394,7 @@ impl WindowPortsMethods for Window {
|
||||||
self.winit_window.id()
|
self.winit_window.id()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn winit_event_to_servo_event(&self, event: winit::event::WindowEvent) {
|
fn winit_event_to_servo_event(&self, event: winit::event::WindowEvent<'_>) {
|
||||||
match event {
|
match event {
|
||||||
winit::event::WindowEvent::ReceivedCharacter(ch) => self.handle_received_character(ch),
|
winit::event::WindowEvent::ReceivedCharacter(ch) => self.handle_received_character(ch),
|
||||||
winit::event::WindowEvent::KeyboardInput { input, .. } => self.handle_keyboard_input(input),
|
winit::event::WindowEvent::KeyboardInput { input, .. } => self.handle_keyboard_input(input),
|
||||||
|
|
|
@ -98,7 +98,7 @@ impl WindowPortsMethods for Window {
|
||||||
self.animation_state.get() == AnimationState::Animating
|
self.animation_state.get() == AnimationState::Animating
|
||||||
}
|
}
|
||||||
|
|
||||||
fn winit_event_to_servo_event(&self, _event: winit::event::WindowEvent) {
|
fn winit_event_to_servo_event(&self, _event: winit::event::WindowEvent<'_>) {
|
||||||
// Not expecting any winit events.
|
// Not expecting any winit events.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ pub trait WindowPortsMethods: WindowMethods {
|
||||||
fn has_events(&self) -> bool;
|
fn has_events(&self) -> bool;
|
||||||
fn page_height(&self) -> f32;
|
fn page_height(&self) -> f32;
|
||||||
fn get_fullscreen(&self) -> bool;
|
fn get_fullscreen(&self) -> bool;
|
||||||
fn winit_event_to_servo_event(&self, event: winit::event::WindowEvent);
|
fn winit_event_to_servo_event(&self, event: winit::event::WindowEvent<'_>);
|
||||||
fn is_animating(&self) -> bool;
|
fn is_animating(&self) -> bool;
|
||||||
fn set_title(&self, _title: &str) {}
|
fn set_title(&self, _title: &str) {}
|
||||||
fn set_inner_size(&self, _size: DeviceIntSize) {}
|
fn set_inner_size(&self, _size: DeviceIntSize) {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue