Skip to content

Commit 7ca522a

Browse files
committed
Remove some dead code in SourceMap
1 parent 9cffcfc commit 7ca522a

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/cargo/core/source/mod.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,6 @@ impl<'src> SourceMap<'src> {
264264
}
265265
}
266266

267-
/// Like `HashMap::contains_key`.
268-
pub fn contains(&self, id: SourceId) -> bool {
269-
self.map.contains_key(&id)
270-
}
271-
272267
/// Like `HashMap::get`.
273268
pub fn get(&self, id: SourceId) -> Option<&(dyn Source + 'src)> {
274269
self.map.get(&id).map(|s| s.as_ref())
@@ -279,32 +274,17 @@ impl<'src> SourceMap<'src> {
279274
self.map.get_mut(&id).map(|s| s.as_mut())
280275
}
281276

282-
/// Like `HashMap::get`, but first calculates the `SourceId` from a `PackageId`.
283-
pub fn get_by_package_id(&self, pkg_id: PackageId) -> Option<&(dyn Source + 'src)> {
284-
self.get(pkg_id.source_id())
285-
}
286-
287277
/// Like `HashMap::insert`, but derives the `SourceId` key from the `Source`.
288278
pub fn insert(&mut self, source: Box<dyn Source + 'src>) {
289279
let id = source.source_id();
290280
self.map.insert(id, source);
291281
}
292282

293-
/// Like `HashMap::is_empty`.
294-
pub fn is_empty(&self) -> bool {
295-
self.map.is_empty()
296-
}
297-
298283
/// Like `HashMap::len`.
299284
pub fn len(&self) -> usize {
300285
self.map.len()
301286
}
302287

303-
/// Like `HashMap::values`.
304-
pub fn sources<'a>(&'a self) -> impl Iterator<Item = &'a Box<dyn Source + 'src>> {
305-
self.map.values()
306-
}
307-
308288
/// Like `HashMap::iter_mut`.
309289
pub fn sources_mut<'a>(
310290
&'a mut self,

0 commit comments

Comments
 (0)