diff --git a/.rustfmt.toml b/.rustfmt.toml new file mode 100644 index 0000000..b7d70c3 --- /dev/null +++ b/.rustfmt.toml @@ -0,0 +1,2 @@ +format_macro_bodies = true +format_macro_matchers = true diff --git a/README.md b/README.md index bad283c..9f08d4b 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ use ratatui::prelude::*; use ratatui_macros::constraints; assert_eq!( - constraints![==50, ==30%, >=3, <=1, ==1/2, =*1], + constraints![==50, ==30%, >=3, <=1, ==1/2, *=1], [ Constraint::Length(50), Constraint::Percentage(30), diff --git a/src/layout.rs b/src/layout.rs index 14aa4d4..7b3c424 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -13,7 +13,7 @@ /// assert_eq!(constraint!(== 1 / 3), Constraint::Ratio(1, 3)); /// assert_eq!(constraint!(== 3), Constraint::Length(3)); /// assert_eq!(constraint!(== 10 %), Constraint::Percentage(10)); -/// assert_eq!(constraint!(=* 1), Constraint::Fill(1)); +/// assert_eq!(constraint!(*= 1), Constraint::Fill(1)); /// ``` #[macro_export] macro_rules! constraint { @@ -32,7 +32,7 @@ macro_rules! constraint { (== $expr:expr) => { ratatui::layout::Constraint::Length($expr) }; - (=* $expr:expr) => { + (*= $expr:expr) => { ratatui::layout::Constraint::Fill($expr) }; } @@ -56,7 +56,7 @@ macro_rules! constraint { /// use ratatui::prelude::*; /// use ratatui_macros::constraints; /// assert_eq!( -/// constraints![==50, ==30%, >=3, <=1, ==1/2, =*1], +/// constraints![==50, ==30%, >=3, <=1, ==1/2, *=1], /// [ /// Constraint::Length(50), /// Constraint::Percentage(30),