Skip to content

Commit

Permalink
use $crate in macro (#270)
Browse files Browse the repository at this point in the history
This is the recommended way of referring to the current crate in a macro.
  • Loading branch information
leoyvens authored Jul 8, 2022
1 parent 63f861c commit 3d818a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ macro_rules! register_custom_getrandom {
// We use an extern "C" function to get the guarantees of a stable ABI.
#[no_mangle]
extern "C" fn __getrandom_custom(dest: *mut u8, len: usize) -> u32 {
let f: fn(&mut [u8]) -> Result<(), ::getrandom::Error> = $path;
let f: fn(&mut [u8]) -> Result<(), $crate::Error> = $path;
let slice = unsafe { ::core::slice::from_raw_parts_mut(dest, len) };
match f(slice) {
Ok(()) => 0,
Expand Down

0 comments on commit 3d818a6

Please sign in to comment.