Use .nth(x) instead of .skip(x).next() on iterators.
This commit is contained in:
parent
5abaeb3d67
commit
c287d86d2c
@ -186,7 +186,7 @@ pub fn get_linker(sess: &Session, linker: &Path, flavor: LinkerFlavor) -> (PathB
|
||||
if flavor == LinkerFlavor::Msvc && t.target_vendor == "uwp" {
|
||||
if let Some(ref tool) = msvc_tool {
|
||||
let original_path = tool.path();
|
||||
if let Some(ref root_lib_path) = original_path.ancestors().skip(4).next() {
|
||||
if let Some(ref root_lib_path) = original_path.ancestors().nth(4) {
|
||||
let arch = match t.arch.as_str() {
|
||||
"x86_64" => Some("x64".to_string()),
|
||||
"x86" => Some("x86".to_string()),
|
||||
|
@ -401,9 +401,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||
if let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(span) {
|
||||
let refs_number =
|
||||
snippet.chars().filter(|c| !c.is_whitespace()).take_while(|c| *c == '&').count();
|
||||
if let Some('\'') =
|
||||
snippet.chars().filter(|c| !c.is_whitespace()).skip(refs_number).next()
|
||||
{
|
||||
if let Some('\'') = snippet.chars().filter(|c| !c.is_whitespace()).nth(refs_number) {
|
||||
// Do not suggest removal of borrow from type arguments.
|
||||
return;
|
||||
}
|
||||
@ -464,9 +462,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||
if let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(span) {
|
||||
let refs_number =
|
||||
snippet.chars().filter(|c| !c.is_whitespace()).take_while(|c| *c == '&').count();
|
||||
if let Some('\'') =
|
||||
snippet.chars().filter(|c| !c.is_whitespace()).skip(refs_number).next()
|
||||
{
|
||||
if let Some('\'') = snippet.chars().filter(|c| !c.is_whitespace()).nth(refs_number) {
|
||||
// Do not suggest removal of borrow from type arguments.
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user