Skip to content

Commit

Permalink
all: fix some style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
manelmontilla committed Dec 18, 2023
1 parent 9caa6bd commit 23db2d0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion wruster/src/http/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl Headers {
pub fn add(&mut self, header: Header) {
let name = header.name;
let content = header.value;
let values = self.headers.entry(name).or_insert_with(Vec::new);
let values = self.headers.entry(name).or_default();
values.push(content);
}

Expand Down
2 changes: 1 addition & 1 deletion wruster/src/streams/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Contains various types that augment a type that can act as a [Stream], e.g.: a [std::net::TcpStream].
Contains various types that augment a [Stream], e.g.: a [std::net::TcpStream].
*/
use std::io::Read;
use std::io::{self, Write};
Expand Down
4 changes: 2 additions & 2 deletions wruster/src/streams/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct TcpClient {
impl TcpClient {
#[allow(dead_code)]
pub fn connect(addr: String) -> Result<Self, Box<dyn Error>> {
let stream = TcpStream::connect(&addr)?;
let stream = TcpStream::connect(addr)?;
let stream = Some(stream);
Ok(TcpClient { stream })
}
Expand Down Expand Up @@ -66,7 +66,7 @@ pub fn load_test_file(name: &str) -> Result<File, io::Error> {
file_path.push("tests/assets");
file_path.push(name);
let file = fs::File::open(&file_path).unwrap();
return Ok(file);
Ok(file)
}

#[allow(dead_code)]
Expand Down

0 comments on commit 23db2d0

Please sign in to comment.