From 495c342ab08f40bc76c6bfa60143c95b12fee022 Mon Sep 17 00:00:00 2001 From: eupn Date: Sun, 31 Mar 2024 21:40:18 +0400 Subject: [PATCH] xtask: rename `BuildStream`'s `to_str` to `as_str` This naming more closely reflects the ownership semantic --- xtask/src/builder.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xtask/src/builder.rs b/xtask/src/builder.rs index 22804b90e..65a80ad5c 100644 --- a/xtask/src/builder.rs +++ b/xtask/src/builder.rs @@ -15,7 +15,7 @@ pub(crate) enum BuildStream { Release, } impl BuildStream { - pub fn to_str(&self) -> &str { + pub fn as_str(&self) -> &str { match self { BuildStream::Debug => "debug", BuildStream::Release => "release", @@ -438,7 +438,7 @@ impl Builder { Some(t) => format!("{}/", t), None => "".to_string(), }, - stream.to_str(), + stream.as_str(), ); remote_args.push(&output_root); @@ -803,7 +803,7 @@ impl Builder { let svd_spec_path = format!( "target/{}/{}/build/SVD_PATH", self.target.as_ref().expect("target"), - self.stream.to_str() + self.stream.as_str() ); let mut svd_spec_file = OpenOptions::new().read(true).open(svd_spec_path)?; let mut svd_path_str = String::new(); @@ -910,7 +910,7 @@ impl Builder { inif: &[String], memory_spec: Vec, ) -> Result { - let stream = self.stream.to_str(); + let stream = self.stream.as_str(); let mut args = vec!["run", "--package", "tools", "--bin", "create-image", "--"]; let mut output_file = PathBuf::new(); @@ -964,7 +964,7 @@ impl Builder { let exec_name = format!( "target/{}/{}/{}", self.target.as_ref().expect("target"), - self.stream.to_str(), + self.stream.as_str(), name ); println!("Fetching {} executable from build server...", name);