File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
src/rust/bitbox02-rust/src Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 13
13
// limitations under the License.
14
14
15
15
/// Firmware version, short format, e.g. "v9.12.0".
16
- // This is evaluated at compile time, if the env var is missing or not set, there will be a compiler error .
16
+ // We don't want this to be a hard error during development so that rust tools are happy .
17
17
pub static FIRMWARE_VERSION_SHORT : & str = {
18
- let version = env ! ( "FIRMWARE_VERSION_SHORT" ) ;
19
- // Need explicit check as the env var could be set to an empty string accidentally (env!() only
20
- // panics if it is not set at all).
21
- if version . is_empty ( ) {
22
- panic ! ( "FIRMWARE_VERSION_SHORT is not set" ) ;
18
+ let version = option_env ! ( "FIRMWARE_VERSION_SHORT" ) ;
19
+ if let Some ( version ) = version {
20
+ version
21
+ } else {
22
+ ""
23
23
}
24
- version
25
24
} ;
You can’t perform that action at this time.
0 commit comments