Skip to content

Commit 3d818a6

Browse files
authored
use $crate in macro (#270)
This is the recommended way of referring to the current crate in a macro.
1 parent 63f861c commit 3d818a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/custom.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ macro_rules! register_custom_getrandom {
7979
// We use an extern "C" function to get the guarantees of a stable ABI.
8080
#[no_mangle]
8181
extern "C" fn __getrandom_custom(dest: *mut u8, len: usize) -> u32 {
82-
let f: fn(&mut [u8]) -> Result<(), ::getrandom::Error> = $path;
82+
let f: fn(&mut [u8]) -> Result<(), $crate::Error> = $path;
8383
let slice = unsafe { ::core::slice::from_raw_parts_mut(dest, len) };
8484
match f(slice) {
8585
Ok(()) => 0,

0 commit comments

Comments
 (0)