MCPcopy Create free account
hub / github.com/Rust-Web-Development/code / get_platform

Function get_platform

ch_10/build.rs:36–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36fn get_platform() -> String {
37 let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default();
38 let os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
39 let env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default();
40 let env_dash = if env.is_empty() { "" } else { "-" };
41
42 format!("{}-{}{}{}", arch, os, env_dash, env)
43}
44
45fn get_version(impl_commit: &str) -> String {
46 let commit_dash = if impl_commit.is_empty() { "" } else { "-" };

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected