feat(Str): Strict impemintation
Added method new() for creating empty string
This commit is contained in:
1 parent
1c47dfc374
commit
2c9f81bf52
1 file changed
+17
@@ -12,3 +12,20 @@ pub struct Str {
|
||||
_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,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user