1
0
Fork 0
forked from wry/wry

all: use let chains

This commit is contained in:
Julian Orth 2025-07-01 11:20:48 +02:00
parent 3d5d146d65
commit 286857971a
89 changed files with 1516 additions and 1574 deletions

View file

@ -17,12 +17,11 @@ fn create_bridge() -> anyhow::Result<()> {
fn create_version() -> anyhow::Result<()> {
let mut version_string = env!("CARGO_PKG_VERSION").to_string();
if let Ok(output) = Command::new("git").arg("rev-parse").arg("HEAD").output() {
if output.status.success() {
if let Ok(commit) = std::str::from_utf8(&output.stdout) {
write!(version_string, " ({})", commit.trim())?;
}
}
if let Ok(output) = Command::new("git").arg("rev-parse").arg("HEAD").output()
&& output.status.success()
&& let Ok(commit) = std::str::from_utf8(&output.stdout)
{
write!(version_string, " ({})", commit.trim())?;
}
let mut f = open("version.rs")?;
writeln!(f, "pub const VERSION: &str = \"{}\";", version_string)?;