The set_len() function can be used to set the length of a Vec. However some caveats to the set_len() function are:
- It is unsafe, thus the unsafe specifier or an unsafe block must be used
- The initialised length must be less then or equal to the capacity of the Vec, therefore you should initialise with_capacity(length) before using set_len(length)