Use next()
instead of peek()
where possible
This commit is contained in:
parent
330ce948f7
commit
71ca8840d5
1 changed files with 3 additions and 3 deletions
|
@ -2028,7 +2028,7 @@ fn strip_generics_from_path(path_str: &str) -> Result<String, ResolutionFailure<
|
||||||
'<' => {
|
'<' => {
|
||||||
segment.push(chr);
|
segment.push(chr);
|
||||||
|
|
||||||
match path.peek() {
|
match path.next() {
|
||||||
Some('<') => {
|
Some('<') => {
|
||||||
return Err(ResolutionFailure::MalformedGenerics(
|
return Err(ResolutionFailure::MalformedGenerics(
|
||||||
MalformedGenerics::TooManyAngleBrackets,
|
MalformedGenerics::TooManyAngleBrackets,
|
||||||
|
@ -2039,8 +2039,8 @@ fn strip_generics_from_path(path_str: &str) -> Result<String, ResolutionFailure<
|
||||||
MalformedGenerics::EmptyAngleBrackets,
|
MalformedGenerics::EmptyAngleBrackets,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
Some(_) => {
|
Some(chr) => {
|
||||||
segment.push(path.next().unwrap());
|
segment.push(chr);
|
||||||
|
|
||||||
while let Some(chr) = path.next_if(|c| *c != '>') {
|
while let Some(chr) = path.next_if(|c| *c != '>') {
|
||||||
segment.push(chr);
|
segment.push(chr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue