Use use declarations rather than '::std::...' names.

This is what most of the rest of the codebase does, so this patch just
tidies up a few additional places.
This commit is contained in:
Dan Gohman
2018-04-19 13:14:12 -07:00
parent acabcc5c8f
commit d72706c478
6 changed files with 24 additions and 13 deletions

View File

@@ -3,6 +3,10 @@
use super::{Comparator, Forest, Node, NodeData, NodePool, Path, INNER_SIZE};
use packed_option::PackedOption;
use std::marker::PhantomData;
#[cfg(test)]
use std::fmt;
#[cfg(test)]
use std::string::String;
/// Tag type defining forest types for a map.
struct MapTypes<K, V, C>(PhantomData<(K, V, C)>);
@@ -207,14 +211,14 @@ where
#[cfg(test)]
impl<K, V, C> Map<K, V, C>
where
K: Copy + ::std::fmt::Display,
K: Copy + fmt::Display,
V: Copy,
C: Comparator<K>,
{
/// Verify consistency.
fn verify(&self, forest: &MapForest<K, V, C>, comp: &C)
where
NodeData<MapTypes<K, V, C>>: ::std::fmt::Display,
NodeData<MapTypes<K, V, C>>: fmt::Display,
{
if let Some(root) = self.root.expand() {
forest.nodes.verify_tree(root, comp);
@@ -222,7 +226,7 @@ where
}
/// Get a text version of the path to `key`.
fn tpath(&self, key: K, forest: &MapForest<K, V, C>, comp: &C) -> ::std::string::String {
fn tpath(&self, key: K, forest: &MapForest<K, V, C>, comp: &C) -> String {
use std::string::ToString;
match self.root.expand() {
None => "map(empty)".to_string(),
@@ -406,8 +410,8 @@ where
#[cfg(test)]
impl<'a, K, V, C> MapCursor<'a, K, V, C>
where
K: Copy + ::std::fmt::Display,
V: Copy + ::std::fmt::Display,
K: Copy + fmt::Display,
V: Copy + fmt::Display,
C: Comparator<K>,
{
fn verify(&self) {
@@ -416,7 +420,7 @@ where
}
/// Get a text version of the path to the current position.
fn tpath(&self) -> ::std::string::String {
fn tpath(&self) -> String {
use std::string::ToString;
self.path.to_string()
}

View File

@@ -3,6 +3,8 @@
use super::{Forest, Node, NodeData};
use entity::PrimaryMap;
use std::ops::{Index, IndexMut};
#[cfg(test)]
use std::fmt;
/// A pool of nodes, including a free list.
pub(super) struct NodePool<F: Forest> {
@@ -74,8 +76,8 @@ impl<F: Forest> NodePool<F> {
/// Verify the consistency of the tree rooted at `node`.
pub fn verify_tree(&self, node: Node, comp: &F::Comparator)
where
NodeData<F>: ::std::fmt::Display,
F::Key: ::std::fmt::Display,
NodeData<F>: fmt::Display,
F::Key: fmt::Display,
{
use super::Comparator;
use entity::SparseSet;

View File

@@ -3,6 +3,10 @@
use super::{Comparator, Forest, Node, NodeData, NodePool, Path, SetValue, INNER_SIZE};
use packed_option::PackedOption;
use std::marker::PhantomData;
#[cfg(test)]
use std::fmt;
#[cfg(test)]
use std::string::String;
/// Tag type defining forest types for a set.
struct SetTypes<K, C>(PhantomData<(K, C)>);
@@ -305,7 +309,7 @@ where
#[cfg(test)]
impl<'a, K, C> SetCursor<'a, K, C>
where
K: Copy + ::std::fmt::Display,
K: Copy + fmt::Display,
C: Comparator<K>,
{
fn verify(&self) {
@@ -314,7 +318,7 @@ where
}
/// Get a text version of the path to the current position.
fn tpath(&self) -> ::std::string::String {
fn tpath(&self) -> String {
use std::string::ToString;
self.path.to_string()
}