[][src]Macro concat_in_place::veccat

macro_rules! veccat {
    ($input:expr, $($element:expr)*) => { ... };
}

Appends any number of slices onto a vector

use concat_in_place::veccat;

let domain = b"domain.com";
let endpoint = b"inventory/parts";
let id = b"10512";

let mut url = Vec::new();
let slice = veccat!(&mut url, domain b"/" endpoint b"/" id);
assert_eq!(slice, b"domain.com/inventory/parts/10512");

Implementation Notes

Technically works with any type that has the following methods:

  • capacity
  • len
  • reserve
  • extend_from_slice