From 9ee52dc5ca0c3fb9684673c0d9d627e8c505ad8d Mon Sep 17 00:00:00 2001 From: Kirill Date: Fri, 12 Dec 2025 13:44:08 +0300 Subject: [PATCH] fix(Str): Fix cargo warnings --- src/string.rs | 4 ++-- src/string/{MyStr_strict.rs => my_str_strict.rs} | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) rename src/string/{MyStr_strict.rs => my_str_strict.rs} (74%) diff --git a/src/string.rs b/src/string.rs index 9d75fb4..02f24e0 100644 --- a/src/string.rs +++ b/src/string.rs @@ -1,3 +1,3 @@ -mod MyStr_strict; +mod my_str_strict; -pub use MyStr_strict::Str; +pub use my_str_strict::Str; diff --git a/src/string/MyStr_strict.rs b/src/string/my_str_strict.rs similarity index 74% rename from src/string/MyStr_strict.rs rename to src/string/my_str_strict.rs index 0476949..15d5af4 100644 --- a/src/string/MyStr_strict.rs +++ b/src/string/my_str_strict.rs @@ -1,3 +1,4 @@ +#[derive(Debug)] enum Status { BUISY, FREE, @@ -6,6 +7,7 @@ enum Status { const SIZE: usize = 15; +#[derive(Debug)] pub struct Str { _data: Vec, _stats: Vec, @@ -15,17 +17,19 @@ pub struct Str { impl Str { pub fn new() -> Self { - Self { + return Self { _data: Vec::with_capacity(SIZE), _stats: { let mut data = Vec::new(); - for i in 0..SIZE { + let mut i: usize = 0; + while i < SIZE { data.push(Status::FREE); + i += 1; } data }, _size: 0, _capacity: SIZE, - } + }; } }