expect: use fully-qualified names in macro
@@ -6,9 +6,10 @@ macro_rules! expect_eq {
match (&$left, &$right) {
(left_val, right_val) => {
if !(*left_val == *right_val) {
- return Err(Box::new(std::io::Error::new(
- std::io::ErrorKind::Other,
- format!(
+ return ::std::result::Result::Err(::std::boxed::Box::new(
+ ::std::io::Error::new(
+ ::std::io::ErrorKind::Other,
+ ::std::format!(
r#"{}:{}: expectation failed: `(left == right)`
left: `{:?}`,
right: `{:?}`"#,
@@ -17,7 +18,8 @@ macro_rules! expect_eq {
&*left_val,
&*right_val
),
- )));
+ ),
+ ));
}
}
}
@@ -32,9 +34,9 @@ macro_rules! expect_matches {
match $e {
$pat => (),
ref e => {
- return Err(Box::new(std::io::Error::new(
- std::io::ErrorKind::Other,
- format!(
+ return ::std::result::Result::Err(::std::boxed::Box::new(::std::io::Error::new(
+ ::std::io::ErrorKind::Other,
+ ::std::format!(
"{}:{}: expectation failed: `{:?}` does not match `{}`",
file!(),
line!(),
@@ -51,9 +53,9 @@ macro_rules! expect_matches {
macro_rules! expect {
( $e:expr ) => {
if !$e {
- return Err(Box::new(std::io::Error::new(
- std::io::ErrorKind::Other,
- format!(
+ return ::std::result::Result::Err(::std::boxed::Box::new(::std::io::Error::new(
+ ::std::io::ErrorKind::Other,
+ ::std::format!(
"{}:{}: expectation failed: {:?} is false",
file!(),
line!(),
