]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #94862 - pierwill:bootstrap-useless, r=Dylan-DPC
authorbors <bors@rust-lang.org>
Sun, 13 Mar 2022 05:37:56 +0000 (05:37 +0000)
committerbors <bors@rust-lang.org>
Sun, 13 Mar 2022 05:37:56 +0000 (05:37 +0000)
Remove unneeded conversions in bootstrapping code

Fixes warnings from `clippy::useless_conversion` in `src/bootstrap`.

src/bootstrap/builder.rs
src/bootstrap/tool.rs

index 1903f0baef1fae4d71a8f0ce3210e3a7e334965b..68ae7f2be96adb7ac684f66347f43f4346b64970 100644 (file)
@@ -169,7 +169,7 @@ fn empty() -> PathSet {
 
     fn one<P: Into<PathBuf>>(path: P, kind: Kind) -> PathSet {
         let mut set = BTreeSet::new();
-        set.insert(TaskPath { path: path.into(), kind: Some(kind.into()) });
+        set.insert(TaskPath { path: path.into(), kind: Some(kind) });
         PathSet::Set(set)
     }
 
@@ -372,10 +372,7 @@ pub fn path(self, path: &str) -> Self {
     // multiple aliases for the same job
     pub fn paths(mut self, paths: &[&str]) -> Self {
         self.paths.insert(PathSet::Set(
-            paths
-                .iter()
-                .map(|p| TaskPath { path: p.into(), kind: Some(self.kind.into()) })
-                .collect(),
+            paths.iter().map(|p| TaskPath { path: p.into(), kind: Some(self.kind) }).collect(),
         ));
         self
     }
@@ -388,8 +385,7 @@ pub fn is_suite_path(&self, path: &Path) -> Option<&PathSet> {
     }
 
     pub fn suite_path(mut self, suite: &str) -> Self {
-        self.paths
-            .insert(PathSet::Suite(TaskPath { path: suite.into(), kind: Some(self.kind.into()) }));
+        self.paths.insert(PathSet::Suite(TaskPath { path: suite.into(), kind: Some(self.kind) }));
         self
     }
 
@@ -1769,7 +1765,7 @@ pub(crate) fn was_invoked_explicitly<S: Step>(&'a self, kind: Kind) -> bool {
             if should_run.paths.iter().any(|s| s.has(path, Some(desc.kind)))
                 && !desc.is_excluded(
                     self,
-                    &PathSet::Suite(TaskPath { path: path.clone(), kind: Some(desc.kind.into()) }),
+                    &PathSet::Suite(TaskPath { path: path.clone(), kind: Some(desc.kind) }),
                 )
             {
                 return true;
index 2ae4d830721e8ad2f22ab900cc998d62d7297fa4..a9ca89bdea1ce8bcf6677e623cf744e05e7f763b 100644 (file)
@@ -391,7 +391,7 @@ pub fn command(builder: &Builder<'_>) -> Command {
         add_dylib_path(
             vec![
                 PathBuf::from(&builder.sysroot_libdir(compiler, compiler.host)),
-                PathBuf::from(builder.rustc_libdir(compiler)),
+                builder.rustc_libdir(compiler),
             ],
             &mut cmd,
         );