master > master: code-rust - String-type macro
This commit is contained in:
20
code/rust/src/rules/convert.rs
Normal file
20
code/rust/src/rules/convert.rs
Normal 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() )* ]
|
||||
};
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
pub mod assert;
|
||||
pub mod convert;
|
||||
|
||||
Reference in New Issue
Block a user