Update src/resp.rs

This commit is contained in:
Григорий Сафронов 2025-05-25 20:32:50 +00:00
parent 804c21b67e
commit 14bd17dc57

View File

@ -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))),
}
}
}
}