Skip to content

Commit

Permalink
allow for 0 argument functions
Browse files Browse the repository at this point in the history
  • Loading branch information
vic1707 committed Oct 27, 2023
1 parent 03276f4 commit c4aabbf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ pub(crate) use yeet;

#[doc(hidden)]
macro_rules! wrap_into_closure {
($function:expr, 0) => {
move |_| $function()
};
($function:expr, 1) => {
#[allow(clippy::indexing_slicing)]
move |args| $function(args[0])
Expand Down

0 comments on commit c4aabbf

Please sign in to comment.