Skip to content

Commit 415d376

Browse files
committed
Remove unneeded conversions in bootstrapping code
Fixes warnings from `clippy::useless_conversion` in `src/bootstrap`.
1 parent af8604f commit 415d376

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/bootstrap/builder.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl PathSet {
169169

170170
fn one<P: Into<PathBuf>>(path: P, kind: Kind) -> PathSet {
171171
let mut set = BTreeSet::new();
172-
set.insert(TaskPath { path: path.into(), kind: Some(kind.into()) });
172+
set.insert(TaskPath { path: path.into(), kind: Some(kind) });
173173
PathSet::Set(set)
174174
}
175175

@@ -372,10 +372,7 @@ impl<'a> ShouldRun<'a> {
372372
// multiple aliases for the same job
373373
pub fn paths(mut self, paths: &[&str]) -> Self {
374374
self.paths.insert(PathSet::Set(
375-
paths
376-
.iter()
377-
.map(|p| TaskPath { path: p.into(), kind: Some(self.kind.into()) })
378-
.collect(),
375+
paths.iter().map(|p| TaskPath { path: p.into(), kind: Some(self.kind) }).collect(),
379376
));
380377
self
381378
}
@@ -388,8 +385,7 @@ impl<'a> ShouldRun<'a> {
388385
}
389386

390387
pub fn suite_path(mut self, suite: &str) -> Self {
391-
self.paths
392-
.insert(PathSet::Suite(TaskPath { path: suite.into(), kind: Some(self.kind.into()) }));
388+
self.paths.insert(PathSet::Suite(TaskPath { path: suite.into(), kind: Some(self.kind) }));
393389
self
394390
}
395391

@@ -1769,7 +1765,7 @@ impl<'a> Builder<'a> {
17691765
if should_run.paths.iter().any(|s| s.has(path, Some(desc.kind)))
17701766
&& !desc.is_excluded(
17711767
self,
1772-
&PathSet::Suite(TaskPath { path: path.clone(), kind: Some(desc.kind.into()) }),
1768+
&PathSet::Suite(TaskPath { path: path.clone(), kind: Some(desc.kind) }),
17731769
)
17741770
{
17751771
return true;

src/bootstrap/tool.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ impl ErrorIndex {
391391
add_dylib_path(
392392
vec![
393393
PathBuf::from(&builder.sysroot_libdir(compiler, compiler.host)),
394-
PathBuf::from(builder.rustc_libdir(compiler)),
394+
builder.rustc_libdir(compiler),
395395
],
396396
&mut cmd,
397397
);

0 commit comments

Comments
 (0)