use $crate in macro (#270)
This is the recommended way of referring to the current crate in a macro.
This commit is contained in:
parent
63f861c684
commit
3d818a6a0a
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user