feat: add function and macro s
to convert to String
This commit is contained in:
parent
96e7d4ebdd
commit
2481db69b1
1 changed files with 14 additions and 0 deletions
|
@ -1 +1,15 @@
|
|||
//
|
||||
#![allow(unused)]
|
||||
|
||||
/// Converts the parameter into a [String] using the [Into] trait.
|
||||
pub fn s(v: impl Into<String>) -> String {
|
||||
v.into()
|
||||
}
|
||||
|
||||
/// Converts the parameter into a [String] by calling `.to_string()`.
|
||||
#[macro_export]
|
||||
macro_rules! s {
|
||||
($value:expr) => {
|
||||
$value.to_string()
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue