master > master: code-rust - String-type macro

This commit is contained in:
RD
2022-04-10 15:42:19 +02:00
parent 5f5165dca8
commit 279677fb7c
5 changed files with 68 additions and 10 deletions

View File

@@ -0,0 +1,20 @@
// ----------------------------------------------------------------
// IMPORTS
// ----------------------------------------------------------------
//
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Conversion macros - arrays
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/// Allows simpler inline creation of vectors of Strings
#[macro_export]
macro_rules! vec_of_strings{
() => {
Vec::<String>::new()
};
($element:expr $(, $elements:expr )* $(,)?)=>{
vec![ $element.to_string() $(, $elements.to_string() )* ]
};
}

View File

@@ -1 +1,2 @@
pub mod assert;
pub mod convert;