From 1385f9917bf4432a548323236e71dda74e58a180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Mon, 17 May 2021 12:26:15 +0200 Subject: [PATCH] str::strip_suffix() is 1.45.0 --- src/ops/config.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ops/config.rs b/src/ops/config.rs index 2b739516cf..b923212c87 100644 --- a/src/ops/config.rs +++ b/src/ops/config.rs @@ -163,7 +163,11 @@ impl PackageConfig { let x = x.as_ref(); res.push("--bin".into()); - res.push(x.strip_suffix(".exe").unwrap_or(x).to_string().into()); + res.push(if x.ends_with(".exe") { + &x[..x.len() - 4] + } else { + x + }.to_string().into()); } } if let Some(true) = self.debug {