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.
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user