Skip to content

Commit

Permalink
Review feedback for collect_intra_doc_links.rs
Browse files Browse the repository at this point in the history
* Add assertion value is defined.
* Simplify comment.
* Fix bad change in err message.
  • Loading branch information
Eric-Arellano committed Dec 8, 2020
1 parent d2de69d commit f68cc68
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Expand Up @@ -435,8 +435,9 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {

// Try looking for methods and associated items.
let mut split = path_str.rsplitn(2, "::");
// NB: the `splitn`'s first element is always defined, even if the delimiter is not present.
// NB: `split`'s first element is always defined, even if the delimiter was not present.
let item_str = split.next().unwrap();
assert!(!item_str.is_empty());
let item_name = Symbol::intern(item_str);
let path_root = split
.next()
Expand All @@ -448,7 +449,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
ResolutionFailure::NotResolved {
module_id,
partial_res: None,
unresolved: path_str.into(),
unresolved: item_str.into(),
}
})?;

Expand Down

0 comments on commit f68cc68

Please sign in to comment.