owoify_rs 2.0.0

This Rust port of mohan-cao's owoify-js is released under MIT license, which is also the same license of owoify-js. This simple library will turn any string into nonsensical babyspeak similar to what LeafySweet's infamous Chrome extension did.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::mem::swap;

pub(crate) fn interleave_arrays<T>(a: Vec<T>, b: Vec<T>) -> Vec<T> {
    let mut arr: Vec<T> = vec![];
    let mut observed = a;
    let mut other = b;

    while !observed.is_empty() {
        arr.push(observed.remove(0));
        swap(&mut observed, &mut other);
    }

    let other_count = other.len();
    if other_count > 0 {
        arr.append(&mut other);
    }
    arr
}