Skip to content

Commit 71ca884

Browse files
committed
Use next() instead of peek() where possible
1 parent 330ce94 commit 71ca884

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2028,7 +2028,7 @@ fn strip_generics_from_path(path_str: &str) -> Result<String, ResolutionFailure<
20282028
'<' => {
20292029
segment.push(chr);
20302030

2031-
match path.peek() {
2031+
match path.next() {
20322032
Some('<') => {
20332033
return Err(ResolutionFailure::MalformedGenerics(
20342034
MalformedGenerics::TooManyAngleBrackets,
@@ -2039,8 +2039,8 @@ fn strip_generics_from_path(path_str: &str) -> Result<String, ResolutionFailure<
20392039
MalformedGenerics::EmptyAngleBrackets,
20402040
));
20412041
}
2042-
Some(_) => {
2043-
segment.push(path.next().unwrap());
2042+
Some(chr) => {
2043+
segment.push(chr);
20442044

20452045
while let Some(chr) = path.next_if(|c| *c != '>') {
20462046
segment.push(chr);

0 commit comments

Comments
 (0)