Use Self type where possible
This commit is contained in:
parent
c4b0f31dbf
commit
e4d292ae58
@ -142,7 +142,7 @@ impl<S: SizeSettings> FromStream<S> for SiteInfo {
|
||||
let up = S::size_from_stream(stream)?;
|
||||
let down = S::size_from_stream(stream)?;
|
||||
|
||||
Ok(SiteInfo {
|
||||
Ok(Self {
|
||||
comments,
|
||||
visits,
|
||||
up,
|
||||
|
||||
@ -10,7 +10,7 @@ pub struct Request {
|
||||
}
|
||||
|
||||
impl Request {
|
||||
pub fn from(mut stream: &TcpStream) -> Option<Request> {
|
||||
pub fn from(mut stream: &TcpStream) -> Option<Self> {
|
||||
let mut buffer = [0; 16384];
|
||||
let _ = stream.read(&mut buffer).ok()?;
|
||||
|
||||
@ -49,7 +49,7 @@ impl Request {
|
||||
request_lines.next();
|
||||
let headers: Vec<String> = request_lines.map(|header| header.to_string()).collect();
|
||||
|
||||
Some(Request {
|
||||
Some(Self {
|
||||
method,
|
||||
path,
|
||||
version,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user