From 773e69078cd959c8d3e13dd8a7dbfaa51f315e6d Mon Sep 17 00:00:00 2001 From: Aneesh Date: Thu, 3 Aug 2023 13:39:38 +0530 Subject: [PATCH] docs(bin,has): add docstrings for macros bin and has --- src/uucore/src/lib/features/fs.rs | 3 +++ src/uucore/src/lib/lib.rs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/uucore/src/lib/features/fs.rs b/src/uucore/src/lib/features/fs.rs index e92d0977f..5804a2235 100644 --- a/src/uucore/src/lib/features/fs.rs +++ b/src/uucore/src/lib/features/fs.rs @@ -31,6 +31,9 @@ use std::path::{Component, Path, PathBuf, MAIN_SEPARATOR}; #[cfg(target_os = "windows")] use winapi_util::AsHandleRef; +/// Used to check if the `mode` has its `perm` bit set. +/// +/// This macro expands to `mode & perm != 0`. #[cfg(unix)] #[macro_export] macro_rules! has { diff --git a/src/uucore/src/lib/lib.rs b/src/uucore/src/lib/lib.rs index ca9a48d25..02724e1bf 100644 --- a/src/uucore/src/lib/lib.rs +++ b/src/uucore/src/lib/lib.rs @@ -86,6 +86,10 @@ use std::sync::atomic::Ordering; use once_cell::sync::Lazy; +/// Execute utility code for `util`. +/// +/// This macro expands to a main function that invokes the `uumain` function in `util` +/// Exits with code returned by `uumain`. #[macro_export] macro_rules! bin { ($util:ident) => {