Skip to content

Commit

Permalink
fix compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-kiegel committed Feb 15, 2019
1 parent 29a4996 commit 55ebfea
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 25 deletions.
29 changes: 12 additions & 17 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ mod format_changeset;
use std::fmt::{self, Debug, Display};
use difference::Changeset;

use format_changeset::format_changeset;
use crate::format_changeset::format_changeset;
pub use ansi_term::Style;

#[doc(hidden)]
Expand Down Expand Up @@ -129,9 +129,17 @@ macro_rules! assert_eq {
}

#[macro_export]
#[doc(hidden)]
macro_rules! __assert_ne {
($left:expr, $right:expr, $maybe_semicolon:expr, $($arg:tt)+) => ({
macro_rules! assert_ne {
($left:expr, $right:expr) => ({
assert_ne!(@ $left, $right, "", "");
});
($left:expr, $right:expr,) => ({
assert_ne!(@ $left, $right, "", "");
});
($left:expr, $right:expr, $($arg:tt)+) => ({
assert_ne!(@ $left, $right, ": ", $($arg)+);
});
(@ $left:expr, $right:expr, $maybe_semicolon:expr, $($arg:tt)+) => ({
match (&($left), &($right)) {
(left_val, right_val) => {
if *left_val == *right_val {
Expand Down Expand Up @@ -170,16 +178,3 @@ macro_rules! __assert_ne {
}
});
}

#[macro_export]
macro_rules! assert_ne {
($left:expr, $right:expr) => ({
__assert_ne!($left, $right, "", "");
});
($left:expr, $right:expr,) => ({
__assert_ne!($left, $right, "", "");
});
($left:expr, $right:expr, $($arg:tt)+) => ({
__assert_ne!($left, $right, ": ", $($arg)+);
});
}
4 changes: 2 additions & 2 deletions tests/assert_eq.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[macro_use]
extern crate pretty_assertions;
#[allow(unused_imports)]
use pretty_assertions::{assert_eq, assert_ne};
extern crate difference;

#[test]
Expand Down
5 changes: 2 additions & 3 deletions tests/assert_ne.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#[macro_use]
extern crate pretty_assertions;

#[allow(unused_imports)]
use pretty_assertions::{assert_eq, assert_ne};
#[test]
#[should_panic(expected = r#"assertion failed: `(left != right)`
Expand Down
5 changes: 2 additions & 3 deletions tests/pretty_string.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#[macro_use]
extern crate pretty_assertions;

#[allow(unused_imports)]
use pretty_assertions::{assert_eq, assert_ne};
use std::fmt;
/// Wrapper around string slice that makes debug output `{:?}` to print string same way as `{}`.
/// Used in different `assert*!` macros in combination with `pretty_assertions` crate to make
Expand Down

0 comments on commit 55ebfea

Please sign in to comment.