Update src/resp.rs
This commit is contained in:
parent
804c21b67e
commit
14bd17dc57
@ -1,4 +1,4 @@
|
|||||||
use std::io::{self, BufRead, Read}; // Убрали Write, добавили Read
|
use std::io::{self, BufRead, Read};
|
||||||
use std::net::TcpStream;
|
use std::net::TcpStream;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@ -12,14 +12,12 @@ pub enum Value {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub struct Decoder<'a> {
|
pub struct Decoder<'a> {
|
||||||
stream: &'a TcpStream,
|
|
||||||
reader: io::BufReader<&'a TcpStream>,
|
reader: io::BufReader<&'a TcpStream>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Decoder<'a> {
|
impl<'a> Decoder<'a> {
|
||||||
pub fn new(stream: &'a TcpStream) -> Self {
|
pub fn new(stream: &'a TcpStream) -> Self {
|
||||||
Self {
|
Self {
|
||||||
stream,
|
|
||||||
reader: io::BufReader::new(stream),
|
reader: io::BufReader::new(stream),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user