alloc crate

版本新特性 / Rust 1.36

// *** 以前 ***
// 没有 std 就没有 Vec 和 String:
// 要么自己写,要么用第三方 crate
#![no_std]

// *** 在 1.36 版本中 ***
// 只要有分配器可用,alloc 就提供 Vec、String 和 Box
#![no_std]
extern crate alloc;

use alloc::string::String;
use alloc::vec::Vec;

fn join(parts: Vec<&str>) -> String {
    parts.concat()
}