From d00f3337f9ec582df341a152ecd08db3302920bc Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 9 Jan 2025 21:27:08 +0000 Subject: [PATCH] docs: differentiate fn `s` from macro `s` --- src/experimental/to_string.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/experimental/to_string.rs b/src/experimental/to_string.rs index 9fe8410..c47724b 100644 --- a/src/experimental/to_string.rs +++ b/src/experimental/to_string.rs @@ -2,11 +2,16 @@ #![allow(unused)] /// Converts the parameter into a [String] using the [Into] trait. +/// +/// Requires parameter to implement a [From] or [Into] trait to allow it be transformed. pub fn s(v: impl Into) -> String { v.into() } /// Converts the parameter into a [String] by calling `.to_string()`. +/// +/// Unlike the [s] function, the value only need to have a [to_string] method. Preusmably it will +/// return a [String], but this macro doesn't make that gaurantee. #[macro_export] macro_rules! s { ($value:expr) => {