docs: differentiate fn s
from macro s
This commit is contained in:
parent
885de22736
commit
d00f3337f9
1 changed files with 5 additions and 0 deletions
|
@ -2,11 +2,16 @@
|
||||||
#![allow(unused)]
|
#![allow(unused)]
|
||||||
|
|
||||||
/// Converts the parameter into a [String] using the [Into] trait.
|
/// 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>) -> String {
|
pub fn s(v: impl Into<String>) -> String {
|
||||||
v.into()
|
v.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Converts the parameter into a [String] by calling `.to_string()`.
|
/// 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_export]
|
||||||
macro_rules! s {
|
macro_rules! s {
|
||||||
($value:expr) => {
|
($value:expr) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue