pub fn push_buffer_to_collection<T>(
collection: &mut Vec<T>,
buffer: &mut String,
)
Expand description
Utility function for pushing a String buffer to a generic collection.
This function checks if the buffer is not empty, converts it to the type T
, and pushes it to
the collection.
§Type Parameters
T
- The type to which the buffer will be converted. It must implement theFrom<String>
trait.
§Arguments
collection
- A mutable reference to the collection of typeVec<T>
where the buffer will be pushed.buffer
- A mutable reference to the String buffer that will be converted and pushed.