mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 22:00:03 -04:00
Clean up some macro syntax
This commit is contained in:
@@ -340,7 +340,7 @@ pub fn normalized_angle(mut angle: f32) -> f32 {
|
||||
#[test]
|
||||
fn test_normalized_angle() {
|
||||
macro_rules! almost_eq {
|
||||
($left:expr, $right:expr) => {
|
||||
($left: expr, $right: expr) => {
|
||||
let left = $left;
|
||||
let right = $right;
|
||||
assert!((left - right).abs() < 1e-6, "{} != {}", left, right);
|
||||
@@ -362,7 +362,7 @@ fn test_normalized_angle() {
|
||||
/// or with the `debug_egui_assert` feature in debug builds.
|
||||
#[macro_export]
|
||||
macro_rules! emath_assert {
|
||||
($($arg:tt)*) => {
|
||||
($($arg: tt)*) => {
|
||||
if cfg!(any(
|
||||
feature = "extra_asserts",
|
||||
all(feature = "extra_debug_asserts", debug_assertions),
|
||||
|
||||
@@ -15,7 +15,7 @@ pub trait Numeric: Clone + Copy + PartialEq + PartialOrd + 'static {
|
||||
}
|
||||
|
||||
macro_rules! impl_numeric_float {
|
||||
($t:ident) => {
|
||||
($t: ident) => {
|
||||
impl Numeric for $t {
|
||||
const INTEGRAL: bool = false;
|
||||
const MIN: Self = std::$t::MIN;
|
||||
@@ -35,7 +35,7 @@ macro_rules! impl_numeric_float {
|
||||
}
|
||||
|
||||
macro_rules! impl_numeric_integer {
|
||||
($t:ident) => {
|
||||
($t: ident) => {
|
||||
impl Numeric for $t {
|
||||
const INTEGRAL: bool = true;
|
||||
const MIN: Self = std::$t::MIN;
|
||||
|
||||
@@ -423,7 +423,7 @@ impl std::fmt::Debug for Vec2 {
|
||||
#[test]
|
||||
fn test_vec2() {
|
||||
macro_rules! almost_eq {
|
||||
($left:expr, $right:expr) => {
|
||||
($left: expr, $right: expr) => {
|
||||
let left = $left;
|
||||
let right = $right;
|
||||
assert!((left - right).abs() < 1e-6, "{} != {}", left, right);
|
||||
|
||||
Reference in New Issue
Block a user