pub fn try_alloc_vec<T: Default + Clone>(
len: usize,
) -> Result<Vec<T>, TryNewError>Expand description
Convenience helper to allocate a default-initialized Vec of a given
length, handling memory allocation failure gracefully.
§Arguments:
len- The length to resize theVecto.
§Errors:
TryNewError::MemoryAllocationFailure- The memory allocation has failed.