Files
Rust/src/string/MyStr_strict.rs
T
Black_Raven 2c9f81bf52 feat(Str): Strict impemintation
Added method new() for creating empty string
2025-12-09 22:15:58 +03:00

32 lines
549 B
Rust

enum Status {
BUISY,
FREE,
DELETED,
}
const SIZE: usize = 15;
pub struct Str {
_data: Vec<char>,
_stats: Vec<Status>,
_size: usize,
_capacity: usize,
}
impl Str {
pub fn new() -> Self {
Self {
_data: Vec::with_capacity(SIZE),
_stats: {
let mut data = Vec::new();
for i in 0..SIZE {
data.push(Status::FREE);
}
data
},
_size: 0,
_capacity: SIZE,
}
}
}