diff --git a/egui/src/lib.rs b/egui/src/lib.rs index ce544235..bc08d18c 100644 --- a/egui/src/lib.rs +++ b/egui/src/lib.rs @@ -425,7 +425,7 @@ pub fn warn_if_debug_build(ui: &mut crate::Ui) { /// ``` #[macro_export] macro_rules! github_link_file_line { - ($github_url:expr, $label:expr) => {{ + ($github_url: expr, $label: expr) => {{ let url = format!("{}{}#L{}", $github_url, file!(), line!()); $crate::Hyperlink::new(url).text($label) }}; @@ -439,7 +439,7 @@ macro_rules! github_link_file_line { /// ``` #[macro_export] macro_rules! github_link_file { - ($github_url:expr, $label:expr) => {{ + ($github_url: expr, $label: expr) => {{ let url = format!("{}{}", $github_url, file!()); $crate::Hyperlink::new(url).text($label) }}; @@ -462,10 +462,10 @@ macro_rules! github_link_file { /// ``` #[macro_export] macro_rules! trace { - ($ui:expr) => {{ + ($ui: expr) => {{ $ui.trace_location(format!("{}:{}", file!(), line!())) }}; - ($ui:expr, $label:expr) => {{ + ($ui: expr, $label: expr) => {{ $ui.trace_location(format!("{} - {}:{}", $label, file!(), line!())) }}; } @@ -476,7 +476,7 @@ macro_rules! trace { /// or with the `debug_egui_assert` feature in debug builds. #[macro_export] macro_rules! egui_assert { - ($($arg:tt)*) => { + ($($arg: tt)*) => { if cfg!(any( feature = "extra_asserts", all(feature = "extra_debug_asserts", debug_assertions), diff --git a/egui_demo_lib/src/lib.rs b/egui_demo_lib/src/lib.rs index 2bd10bce..4eb7a4ab 100644 --- a/egui_demo_lib/src/lib.rs +++ b/egui_demo_lib/src/lib.rs @@ -92,7 +92,7 @@ macro_rules! __egui_github_link_file { () => { crate::__egui_github_link_file!("(source code)") }; - ($label:expr) => { + ($label: expr) => { egui::github_link_file!("https://github.com/emilk/egui/blob/master/", $label).small() }; } @@ -104,7 +104,7 @@ macro_rules! __egui_github_link_file_line { () => { crate::__egui_github_link_file_line!("(source code)") }; - ($label:expr) => { + ($label: expr) => { egui::github_link_file_line!("https://github.com/emilk/egui/blob/master/", $label).small() }; } diff --git a/emath/src/lib.rs b/emath/src/lib.rs index d8fb5ce6..315d7a44 100644 --- a/emath/src/lib.rs +++ b/emath/src/lib.rs @@ -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), diff --git a/emath/src/numeric.rs b/emath/src/numeric.rs index 5a8f670c..a9f088d3 100644 --- a/emath/src/numeric.rs +++ b/emath/src/numeric.rs @@ -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; diff --git a/emath/src/vec2.rs b/emath/src/vec2.rs index d5eaaf3a..066eb858 100644 --- a/emath/src/vec2.rs +++ b/emath/src/vec2.rs @@ -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); diff --git a/epaint/src/lib.rs b/epaint/src/lib.rs index 9918d82a..8ed2edfc 100644 --- a/epaint/src/lib.rs +++ b/epaint/src/lib.rs @@ -157,7 +157,7 @@ pub struct ClippedMesh( /// or with the `debug_egui_assert` feature in debug builds. #[macro_export] macro_rules! epaint_assert { - ($($arg:tt)*) => { + ($($arg: tt)*) => { if cfg!(any( feature = "extra_asserts", all(feature = "extra_debug_asserts", debug_assertions),