Skip to content

Commit

Permalink
treewide: Reduce use of cstr! macro in favor of c"" literals
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Aug 28, 2024
1 parent ad8c467 commit 1160764
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ mutex-trait = "0.2"

bare-metal = "1"

# Only used for shell, where a macro is described to take a string literal and
# in the macro implementation turns it into a CStr.
cstr = "^0.2.11"

heapless = "^0.8"
Expand Down
2 changes: 1 addition & 1 deletion src/gcoap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ where
/// [coap_handler::Handler], you can wrap it in [crate::coap_handler::GcoapHandler] to for adaptation.
pub fn new_catch_all(handler: &'a mut H) -> Self {
Self::new(
cstr::cstr!("/"),
c"/",
riot_sys::COAP_GET
| riot_sys::COAP_POST
| riot_sys::COAP_PUT
Expand Down
2 changes: 1 addition & 1 deletion src/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn panic(info: &::core::panic::PanicInfo) -> ! {
unsafe {
riot_sys::core_panic(
riot_sys::core_panic_t_PANIC_GENERAL_ERROR,
cstr::cstr!("RUST PANIC").as_ptr() as _,
c"RUST PANIC".as_ptr() as _,
)
};
} else {
Expand Down

0 comments on commit 1160764

Please sign in to comment.