diff --git a/src/resp.rs b/src/resp.rs index 7546f58..13b0310 100644 --- a/src/resp.rs +++ b/src/resp.rs @@ -1,4 +1,4 @@ -use std::io::{self, BufRead, Read}; // Убрали Write, добавили Read +use std::io::{self, BufRead, Read}; use std::net::TcpStream; #[derive(Debug)] @@ -12,14 +12,12 @@ pub enum Value { } pub struct Decoder<'a> { - stream: &'a TcpStream, reader: io::BufReader<&'a TcpStream>, } impl<'a> Decoder<'a> { pub fn new(stream: &'a TcpStream) -> Self { Self { - stream, reader: io::BufReader::new(stream), } } @@ -80,4 +78,4 @@ impl<'a> Decoder<'a> { _ => Err(io::Error::new(io::ErrorKind::InvalidData, format!("Unknown prefix: {}", prefix))), } } -} +} \ No newline at end of file