Skip to content

Commit bf47641

Browse files
committed
compiler: fix unused_peekable clippy lint
warning: `peek` never called on `Peekable` iterator --> compiler\rustc_session\src\utils.rs:130:13 | 130 | let mut args = std::env::args_os().map(|arg| arg.to_string_lossy().to_string()).peekable(); | ^^^^ | = help: consider removing the call to `peekable` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_peekable warning: `peek` never called on `Peekable` iterator --> compiler\rustc_trait_selection\src\traits\error_reporting\suggestions.rs:4934:17 | 4934 | let mut bounds = pred.bounds.iter().peekable(); | ^^^^^^ | = help: consider removing the call to `peekable` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_peekable
1 parent 463a11b commit bf47641

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_session/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ pub fn extra_compiler_flags() -> Option<(Vec<String>, bool)> {
127127

128128
const ICE_REPORT_COMPILER_FLAGS_STRIP_VALUE: &[&str] = &["incremental"];
129129

130-
let mut args = std::env::args_os().map(|arg| arg.to_string_lossy().to_string()).peekable();
130+
let mut args = std::env::args_os().map(|arg| arg.to_string_lossy().to_string());
131131

132132
let mut result = Vec::new();
133133
let mut excluded_cargo_defaults = false;

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4931,7 +4931,7 @@ fn point_at_assoc_type_restriction<G: EmissionGuarantee>(
49314931
let hir::WherePredicate::BoundPredicate(pred) = pred else {
49324932
continue;
49334933
};
4934-
let mut bounds = pred.bounds.iter().peekable();
4934+
let mut bounds = pred.bounds.iter();
49354935
while let Some(bound) = bounds.next() {
49364936
let Some(trait_ref) = bound.trait_ref() else {
49374937
continue;

0 commit comments

Comments
 (0)