Need to consider different implementations of String kinds in Rust, and additionally how we may want to `impl Copy for Str`, i.e. `std::mem::swap` with placeholders to keep performance up.

pull/3195/head
David Golembiowski 2020-05-01 17:25:02 -04:00
parent 38b80f6c6b
commit e6837f7394
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
pub const MAXLEN: u32 = 1024;
#[derive(Clone, Debug)]
struct Str {
length: u32,
data: Vec<char>
}
impl Str {
pub fn new(len_u32: u32, data_string: String) -> Str {
Str {
length: len_u32,
data: data_string.chars().collect()
}
}
}