From 2c9f81bf52c0e5a6a4958da847eea4ca0d4515f3 Mon Sep 17 00:00:00 2001 From: Kirill Date: Tue, 9 Dec 2025 22:14:46 +0300 Subject: [PATCH] feat(Str): Strict impemintation Added method new() for creating empty string --- src/string/MyStr_strict.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/string/MyStr_strict.rs b/src/string/MyStr_strict.rs index 8a70cc1..0476949 100644 --- a/src/string/MyStr_strict.rs +++ b/src/string/MyStr_strict.rs @@ -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, + } + } +}