Use Default everywhere
This commit is contained in:
@@ -28,9 +28,6 @@ impl fmt::Debug for PathMap {
|
||||
}
|
||||
|
||||
impl PathMap {
|
||||
pub fn new() -> PathMap {
|
||||
Default::default()
|
||||
}
|
||||
pub fn get_or_insert(&mut self, path: PathBuf, root: Root) -> (bool, FileId) {
|
||||
let mut inserted = false;
|
||||
let file_id = self
|
||||
@@ -117,7 +114,7 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn test_resolve() {
|
||||
let mut m = PathMap::new();
|
||||
let mut m = PathMap::default();
|
||||
let (_, id1) = m.get_or_insert(PathBuf::from("/foo"), Root::Workspace);
|
||||
let (_, id2) = m.get_or_insert(PathBuf::from("/foo/bar.rs"), Root::Workspace);
|
||||
assert_eq!(m.resolve(id1, &RelativePath::new("bar.rs")), Some(id2),)
|
||||
|
||||
Reference in New Issue
Block a user