Skip to content

Commit fa75371

Browse files
committed
Don't crash when not compiling for AVR and executing 'is_compiling_for_avr
1 parent 474d9b9 commit fa75371

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/current.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ pub fn mcu_name() -> Option<String> {
3030

3131
/// Checks if the current cargo target architecture is AVR.
3232
pub fn is_compiling_for_avr() -> bool {
33-
env::var("CARGO_CFG_TARGET_ARCH").unwrap() == "avr"
33+
env::var("CARGO_CFG_TARGET_ARCH") == Ok("avr".to_string())
3434
}
3535

0 commit comments

Comments
 (0)