error cleanup

This commit is contained in:
Christien Rioux
2023-10-21 15:00:50 -04:00
parent 97be49a9a7
commit 697ac5e9ce
35 changed files with 205 additions and 251 deletions

View File

@@ -218,7 +218,7 @@ impl<T> NetworkResult<T> {
Self::Value(v) => NetworkResult::<X>::Value(f(v)),
}
}
pub fn into_result(self) -> Result<T, io::Error> {
pub fn into_io_result(self) -> Result<T, io::Error> {
match self {
Self::Timeout => Err(io::Error::new(io::ErrorKind::TimedOut, "Timed out")),
Self::ServiceUnavailable(s) => Err(io::Error::new(

View File

@@ -52,7 +52,7 @@ pub async fn test_single_out_in() {
// Send to input
let r_message = assbuf_in
.insert_frame(&frame, r_remote_addr)
.into_result()
.into_io_result()
.expect("should get a value")
.expect("should get something out");
@@ -114,7 +114,7 @@ pub async fn test_one_frag_out_in() {
// Send to input
let r_message = assbuf_in
.insert_frame(&frame, r_remote_addr)
.into_result()
.into_io_result()
.expect("should get a value");
// We should have gotten the same message
@@ -179,7 +179,7 @@ pub async fn test_many_frags_out_in() {
// Send to input
let r_message = assbuf_in
.insert_frame(&frame, r_remote_addr)
.into_result()
.into_io_result()
.expect("should get a value");
// We should have gotten the same message
@@ -244,7 +244,7 @@ pub async fn test_many_frags_out_in_single_host() {
// Send to input
let r_message = assbuf_in
.insert_frame(&frame, r_remote_addr)
.into_result()
.into_io_result()
.expect("should get a value");
// We should have gotten the same message
@@ -322,7 +322,7 @@ pub async fn test_many_frags_with_drops() {
// Send to input
let r_message = assbuf_in
.insert_frame(&frame, r_remote_addr)
.into_result()
.into_io_result()
.expect("should get a value");
// We should have gotten the same message
@@ -399,7 +399,7 @@ pub async fn test_many_frags_reordered() {
// Send to input
let r_message = assbuf_in
.insert_frame(&frame, r_remote_addr)
.into_result()
.into_io_result()
.expect("should get a value");
// We should have gotten the same message