Skip to content

Commit

Permalink
use match instead of unwrap_or
Browse files Browse the repository at this point in the history
  • Loading branch information
melody-rs committed Aug 16, 2024
1 parent 73f4a4c commit dcb87fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ const fn git_revision() -> &'static str {
{
git_version::git_version!()
}
// I would reach for unwrap_or but it's not const fn yet
#[cfg(target_arch = "wasm32")]
option_env!("LUMINOL_VERSION").unwrap_or(git_version::git_version!())
match option_env!("LUMINOL_VERSION") {
Some(v) => v,
None => git_version::git_version!(),
}
}

pub const BUILD_DIAGNOSTIC: luminol_core::BuildDiagnostics = luminol_core::BuildDiagnostics {
Expand Down

0 comments on commit dcb87fb

Please sign in to comment.