fix(Str): Fix cargo warnings
This commit is contained in:
1 parent
86fb44c129
commit
9ee52dc5ca
2 files changed
+9
-5
No files matched your search
+2
-2
@@ -1,3 +1,3 @@
|
||||
mod MyStr_strict;
|
||||
mod my_str_strict;
|
||||
|
||||
pub use MyStr_strict::Str;
|
||||
pub use my_str_strict::Str;
|
||||
@@ -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<char>,
|
||||
_stats: Vec<Status>,
|
||||
@@ -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,
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user