error cleanup
This commit is contained in:
		@@ -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(
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user