about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamelid <camelidcamel@gmail.com>2020-10-09 16:08:15 -0700
committerCamelid <camelidcamel@gmail.com>2020-10-09 16:08:15 -0700
commit71ca8840d54a4a35ab51ffdf9e6e4f5469abcf77 (patch)
treeb4869832862b0a7a8acde641a0704d1b05daa85e
parent330ce948f7a0c338ba669bfe904a9619f9589c9e (diff)
downloadrust-71ca8840d54a4a35ab51ffdf9e6e4f5469abcf77.tar.gz
rust-71ca8840d54a4a35ab51ffdf9e6e4f5469abcf77.zip
Use `next()` instead of `peek()` where possible
-rw-r--r--src/librustdoc/passes/collect_intra_doc_links.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs
index 33fa5a5033b..4b455c6fea7 100644
--- a/src/librustdoc/passes/collect_intra_doc_links.rs
+++ b/src/librustdoc/passes/collect_intra_doc_links.rs
@@ -2028,7 +2028,7 @@ fn strip_generics_from_path(path_str: &str) -> Result<String, ResolutionFailure<
             '<' => {
                 segment.push(chr);
 
-                match path.peek() {
+                match path.next() {
                     Some('<') => {
                         return Err(ResolutionFailure::MalformedGenerics(
                             MalformedGenerics::TooManyAngleBrackets,
@@ -2039,8 +2039,8 @@ fn strip_generics_from_path(path_str: &str) -> Result<String, ResolutionFailure<
                             MalformedGenerics::EmptyAngleBrackets,
                         ));
                     }
-                    Some(_) => {
-                        segment.push(path.next().unwrap());
+                    Some(chr) => {
+                        segment.push(chr);
 
                         while let Some(chr) = path.next_if(|c| *c != '>') {
                             segment.push(chr);