Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jking-aus committed Dec 6, 2024
2 parents 0286957 + d0f5aba commit 3cf5dec
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions anchor/client/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ fn allocator_name() -> &'static str {
}
}

fn build_profile_name() -> String {
fn build_profile_name() -> &'static str {
// Nice hack from https://stackoverflow.com/questions/73595435/how-to-get-profile-from-cargo-toml-in-build-rs-or-at-runtime
// The profile name is always the 3rd last part of the path (with 1 based indexing).
// e.g. /code/core/target/cli/build/my-build-info-9f91ba6f99d7a061/out
std::env!("OUT_DIR")
env!("OUT_DIR")
.split(std::path::MAIN_SEPARATOR)
.nth_back(3)
.unwrap_or("unknown")
.to_string()
.unwrap_or(&"unknown")
}

#[derive(Clone, Copy, Debug, PartialEq, Deserialize, Serialize, Display, ValueEnum)]
Expand Down

0 comments on commit 3cf5dec

Please sign in to comment.