Skip to content

Commit

Permalink
Remove trailing semicolons from macros
Browse files Browse the repository at this point in the history
Marcos should not have trailing semicolons and they fail to compile
in the latest nightly.
  • Loading branch information
MitMaro committed Feb 5, 2021
1 parent 76efeed commit 54fd99a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
8 changes: 5 additions & 3 deletions scripts/format.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ set -e
set -u
set -o pipefail

rustup update nightly
rustup component add rustfmt --toolchain nightly
cargo +nightly fmt --all -- --check
RUST_VERSION="nightly-2021-01-31"

rustup update "$RUST_VERSION"
rustup component add rustfmt --toolchain "$RUST_VERSION"
cargo +"$RUST_VERSION" fmt --all -- --check

6 changes: 3 additions & 3 deletions src/display/testutil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn _create_key_event(c: KeyCode, modifiers: &[String]) -> Event {
#[macro_export]
macro_rules! create_key_event {
($char:expr) => {
crate::display::testutil::_create_key_event(crate::display::KeyCode::Char($char), &[]);
crate::display::testutil::_create_key_event(crate::display::KeyCode::Char($char), &[])
};
($char:expr, $($modifiers:expr),*) => {
{
Expand All @@ -58,12 +58,12 @@ macro_rules! create_key_event {
}
};
(code $code:expr) => {
crate::display::testutil::_create_key_event($code, &[]);
crate::display::testutil::_create_key_event($code, &[])
};
(code $code:expr, $($modifiers:expr),*) => {
let mut modifiers = vec![];
$( modifiers.push(String::from($modifiers)); )*
crate::display::testutil::_create_key_event($code, &modifiers);
crate::display::testutil::_create_key_event($code, &modifiers)
};
}

Expand Down
14 changes: 7 additions & 7 deletions src/process/testutil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,25 +313,25 @@ pub fn _assert_process_result(
#[macro_export]
macro_rules! assert_process_result {
($actual:expr) => {
crate::process::testutil::_assert_process_result(&$actual, None, None, None, &None);
crate::process::testutil::_assert_process_result(&$actual, None, None, None, &None)
};
($actual:expr, error = $error:expr, exit_status = $exit_status:expr) => {
crate::process::testutil::_assert_process_result(&$actual, None, None, Some($exit_status), &Some($error));
crate::process::testutil::_assert_process_result(&$actual, None, None, Some($exit_status), &Some($error))
};
($actual:expr, state = $state:expr) => {
crate::process::testutil::_assert_process_result(&$actual, None, Some($state), None, &None);
crate::process::testutil::_assert_process_result(&$actual, None, Some($state), None, &None)
};
($actual:expr, state = $state:expr, error = $error:expr) => {
crate::process::testutil::_assert_process_result(&$actual, None, Some($state), None, &Some($error));
crate::process::testutil::_assert_process_result(&$actual, None, Some($state), None, &Some($error))
};
($actual:expr, input = $input:expr) => {
crate::process::testutil::_assert_process_result(&$actual, Some($input), None, None, &None);
crate::process::testutil::_assert_process_result(&$actual, Some($input), None, None, &None)
};
($actual:expr, input = $input:expr, state = $state:expr) => {
crate::process::testutil::_assert_process_result(&$actual, Some($input), Some($state), None, &None);
crate::process::testutil::_assert_process_result(&$actual, Some($input), Some($state), None, &None)
};
($actual:expr, input = $input:expr, exit_status = $exit_status:expr) => {
crate::process::testutil::_assert_process_result(&$actual, Some($input), None, Some($exit_status), &None);
crate::process::testutil::_assert_process_result(&$actual, Some($input), None, Some($exit_status), &None)
};
}

Expand Down
4 changes: 2 additions & 2 deletions src/testutil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub fn _assert_exit_status(actual: &Result<ExitStatus, Exit>, expected: &Result<
#[macro_export]
macro_rules! assert_exit_status {
($actual:expr, status = $status:expr) => {
crate::testutil::_assert_exit_status(&$actual, &Ok($status));
crate::testutil::_assert_exit_status(&$actual, &Ok($status))
};
($actual:expr, message = $message:expr, status = $status:expr) => {
crate::testutil::_assert_exit_status(
Expand All @@ -58,6 +58,6 @@ macro_rules! assert_exit_status {
message: String::from($message),
status: $status,
}),
);
)
};
}

0 comments on commit 54fd99a

Please sign in to comment.