diff --git a/xtask/src/artifact.rs b/xtask/src/artifact.rs index 5d0dbf8642..57ef29ed3b 100644 --- a/xtask/src/artifact.rs +++ b/xtask/src/artifact.rs @@ -45,26 +45,38 @@ impl Artifact { } pub fn builtins_archive(&self) -> Archive { - let mut builtins_archive = self.target_dir().to_path_buf(); - builtins_archive.push(self.arch.hermit_triple()); - builtins_archive.push("release"); - builtins_archive.push("libhermit_builtins.a"); - builtins_archive.into() + [ + self.target_dir(), + self.arch.hermit_triple().as_ref(), + "release".as_ref(), + "libhermit_builtins.a".as_ref(), + ] + .iter() + .collect::() + .into() } pub fn build_archive(&self) -> Archive { - let mut built_archive = self.target_dir().to_path_buf(); - built_archive.push(self.arch.triple()); - built_archive.push(self.profile_path_component()); - built_archive.push("libhermit.a"); - built_archive.into() + [ + self.target_dir(), + self.arch.triple().as_ref(), + self.profile_path_component().as_ref(), + "libhermit.a".as_ref(), + ] + .iter() + .collect::() + .into() } pub fn dist_archive(&self) -> Archive { - let mut dist_archive = self.target_dir().to_path_buf(); - dist_archive.push(self.arch.name()); - dist_archive.push(self.profile_path_component()); - dist_archive.push("libhermit.a"); - dist_archive.into() + [ + self.target_dir(), + self.arch.name().as_ref(), + self.profile_path_component().as_ref(), + "libhermit.a".as_ref(), + ] + .iter() + .collect::() + .into() } }