Skip to content

Commit 44f4289

Browse files
committed
Replace crate with $crate in our macro definitions
1 parent 432e8c2 commit 44f4289

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

procfs-core/src/lib.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub trait IntoResult<T, E> {
103103
#[doc(hidden)]
104104
macro_rules! build_internal_error {
105105
($err: expr) => {
106-
crate::ProcError::InternalError(crate::InternalError {
106+
$crate::ProcError::InternalError($crate::InternalError {
107107
msg: format!("Internal Unwrap Error: {}", $err),
108108
file: file!(),
109109
line: line!(),
@@ -112,7 +112,7 @@ macro_rules! build_internal_error {
112112
})
113113
};
114114
($err: expr, $msg: expr) => {
115-
crate::ProcError::InternalError(crate::InternalError {
115+
$crate::ProcError::InternalError($crate::InternalError {
116116
msg: format!("Internal Unwrap Error: {}: {}", $msg, $err),
117117
file: file!(),
118118
line: line!(),
@@ -150,15 +150,15 @@ impl<T, E> IntoResult<T, E> for Result<T, E> {
150150
#[doc(hidden)]
151151
macro_rules! proc_panic {
152152
($e:expr) => {
153-
crate::IntoOption::into_option($e).unwrap_or_else(|| {
153+
$crate::IntoOption::into_option($e).unwrap_or_else(|| {
154154
panic!(
155155
"Failed to unwrap {}. Please report this as a procfs bug.",
156156
stringify!($e)
157157
)
158158
})
159159
};
160160
($e:expr, $msg:expr) => {
161-
crate::IntoOption::into_option($e).unwrap_or_else(|| {
161+
$crate::IntoOption::into_option($e).unwrap_or_else(|| {
162162
panic!(
163163
"Failed to unwrap {} ({}). Please report this as a procfs bug.",
164164
stringify!($e),
@@ -172,15 +172,15 @@ macro_rules! proc_panic {
172172
#[doc(hidden)]
173173
macro_rules! expect {
174174
($e:expr) => {
175-
match crate::IntoResult::into($e) {
175+
match $crate::IntoResult::into($e) {
176176
Ok(v) => v,
177-
Err(e) => return Err(crate::build_internal_error!(e)),
177+
Err(e) => return Err($crate::build_internal_error!(e)),
178178
}
179179
};
180180
($e:expr, $msg:expr) => {
181-
match crate::IntoResult::into($e) {
181+
match $crate::IntoResult::into($e) {
182182
Ok(v) => v,
183-
Err(e) => return Err(crate::build_internal_error!(e, $msg)),
183+
Err(e) => return Err($crate::build_internal_error!(e, $msg)),
184184
}
185185
};
186186
}
@@ -190,21 +190,21 @@ macro_rules! expect {
190190
macro_rules! from_str {
191191
($t:tt, $e:expr) => {{
192192
let e = $e;
193-
crate::expect!(
193+
$crate::expect!(
194194
$t::from_str_radix(e, 10),
195195
format!("Failed to parse {} ({:?}) as a {}", stringify!($e), e, stringify!($t),)
196196
)
197197
}};
198198
($t:tt, $e:expr, $radix:expr) => {{
199199
let e = $e;
200-
crate::expect!(
200+
$crate::expect!(
201201
$t::from_str_radix(e, $radix),
202202
format!("Failed to parse {} ({:?}) as a {}", stringify!($e), e, stringify!($t))
203203
)
204204
}};
205205
($t:tt, $e:expr, $radix:expr, pid:$pid:expr) => {{
206206
let e = $e;
207-
crate::expect!(
207+
$crate::expect!(
208208
$t::from_str_radix(e, $radix),
209209
format!(
210210
"Failed to parse {} ({:?}) as a {} (pid {})",

0 commit comments

Comments
 (0)