@@ -12,7 +12,7 @@ macro_rules! unimpl {
1212    ( )  => { 
1313        return  Err ( io:: const_error!( 
1414            io:: ErrorKind :: Unsupported , 
15-             & "This function is not yet implemented" , 
15+             "This function is not yet implemented" , 
1616        ) ) ; 
1717    } ; 
1818} 
@@ -96,7 +96,7 @@ impl TcpStream {
9696            0 , 
9797            4096 , 
9898        )  else  { 
99-             return  Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  & "Invalid response" ) ) ; 
99+             return  Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  "Invalid response" ) ) ; 
100100        } ; 
101101
102102        // The first four bytes should be zero upon success, and will be nonzero 
@@ -106,13 +106,13 @@ impl TcpStream {
106106            // errcode is a u8 but stuck in a u16 where the upper byte is invalid. Mask & decode accordingly. 
107107            let  errcode = response[ 0 ] ; 
108108            if  errcode == NetError :: SocketInUse  as  u8  { 
109-                 return  Err ( io:: const_error!( io:: ErrorKind :: ResourceBusy ,  & "Socket in use" , ) ) ; 
109+                 return  Err ( io:: const_error!( io:: ErrorKind :: ResourceBusy ,  "Socket in use" ) ) ; 
110110            }  else  if  errcode == NetError :: Unaddressable  as  u8  { 
111-                 return  Err ( io:: const_error!( io:: ErrorKind :: AddrNotAvailable ,  & "Invalid address" , ) ) ; 
111+                 return  Err ( io:: const_error!( io:: ErrorKind :: AddrNotAvailable ,  "Invalid address" ) ) ; 
112112            }  else  { 
113113                return  Err ( io:: const_error!( 
114114                    io:: ErrorKind :: InvalidInput , 
115-                     & "Unable to connect or internal error" , 
115+                     "Unable to connect or internal error" , 
116116                ) ) ; 
117117            } 
118118        } 
@@ -198,7 +198,7 @@ impl TcpStream {
198198        )  else  { 
199199            return  Err ( io:: const_error!( 
200200                io:: ErrorKind :: InvalidInput , 
201-                 & "Library failure: wrong message type or messaging error" 
201+                 "Library failure: wrong message type or messaging error" , 
202202            ) ) ; 
203203        } ; 
204204
@@ -212,14 +212,14 @@ impl TcpStream {
212212            if  result[ 0 ]  != 0  { 
213213                if  result[ 1 ]  == 8  { 
214214                    // timed out 
215-                     return  Err ( io:: const_error!( io:: ErrorKind :: TimedOut ,  & "Timeout" , ) ) ; 
215+                     return  Err ( io:: const_error!( io:: ErrorKind :: TimedOut ,  "Timeout" ) ) ; 
216216                } 
217217                if  result[ 1 ]  == 9  { 
218218                    // would block 
219-                     return  Err ( io:: const_error!( io:: ErrorKind :: WouldBlock ,  & "Would block" , ) ) ; 
219+                     return  Err ( io:: const_error!( io:: ErrorKind :: WouldBlock ,  "Would block" ) ) ; 
220220                } 
221221            } 
222-             Err ( io:: const_error!( io:: ErrorKind :: Other ,  & "recv_slice failure" ) ) 
222+             Err ( io:: const_error!( io:: ErrorKind :: Other ,  "recv_slice failure" ) ) 
223223        } 
224224    } 
225225
@@ -258,20 +258,20 @@ impl TcpStream {
258258            self . write_timeout . load ( Ordering :: Relaxed )  as  usize , 
259259            buf_len, 
260260        ) 
261-         . or ( Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  & "Internal error" ) ) ) ?; 
261+         . or ( Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  "Internal error" ) ) ) ?; 
262262
263263        if  send_request. raw [ 0 ]  != 0  { 
264264            if  send_request. raw [ 4 ]  == 8  { 
265265                // timed out 
266266                return  Err ( io:: const_error!( 
267267                    io:: ErrorKind :: BrokenPipe , 
268-                     & "Timeout or connection closed" , 
268+                     "Timeout or connection closed" , 
269269                ) ) ; 
270270            }  else  if  send_request. raw [ 4 ]  == 9  { 
271271                // would block 
272-                 return  Err ( io:: const_error!( io:: ErrorKind :: WouldBlock ,  & "Would block" , ) ) ; 
272+                 return  Err ( io:: const_error!( io:: ErrorKind :: WouldBlock ,  "Would block" ) ) ; 
273273            }  else  { 
274-                 return  Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  & "Error when sending" , ) ) ; 
274+                 return  Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  "Error when sending" ) ) ; 
275275            } 
276276        } 
277277        Ok ( u32:: from_le_bytes ( [ 
@@ -304,7 +304,7 @@ impl TcpStream {
304304            0 , 
305305            0 , 
306306        )  else  { 
307-             return  Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  & "Internal error" ) ) ; 
307+             return  Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  "Internal error" ) ) ; 
308308        } ; 
309309        let  mut  i = get_addr. raw . iter ( ) ; 
310310        match  * i. next ( ) . unwrap ( )  { 
@@ -324,7 +324,7 @@ impl TcpStream {
324324                } 
325325                Ok ( SocketAddr :: V6 ( SocketAddrV6 :: new ( new_addr. into ( ) ,  self . local_port ,  0 ,  0 ) ) ) 
326326            } 
327-             _ => Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  & "Internal error" ) ) , 
327+             _ => Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  "Internal error" ) ) , 
328328        } 
329329    } 
330330
@@ -333,7 +333,7 @@ impl TcpStream {
333333            services:: net_server ( ) , 
334334            services:: NetBlockingScalar :: StdTcpStreamShutdown ( self . fd ,  how) . into ( ) , 
335335        ) 
336-         . or ( Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  & "Unexpected return value" ) ) ) 
336+         . or ( Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  "Unexpected return value" ) ) ) 
337337        . map ( |_| ( ) ) 
338338    } 
339339
@@ -355,7 +355,7 @@ impl TcpStream {
355355            services:: net_server ( ) , 
356356            services:: NetBlockingScalar :: StdSetNodelay ( self . fd ,  enabled) . into ( ) , 
357357        ) 
358-         . or ( Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  & "Unexpected return value" ) ) ) 
358+         . or ( Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  "Unexpected return value" ) ) ) 
359359        . map ( |_| ( ) ) 
360360    } 
361361
@@ -364,19 +364,19 @@ impl TcpStream {
364364            services:: net_server ( ) , 
365365            services:: NetBlockingScalar :: StdGetNodelay ( self . fd ) . into ( ) , 
366366        ) 
367-         . or ( Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  & "Unexpected return value" ) ) ) 
367+         . or ( Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  "Unexpected return value" ) ) ) 
368368        . map ( |res| res[ 0 ]  != 0 ) ?) 
369369    } 
370370
371371    pub  fn  set_ttl ( & self ,  ttl :  u32 )  -> io:: Result < ( ) >  { 
372372        if  ttl > 255  { 
373-             return  Err ( io:: Error :: new ( io:: ErrorKind :: InvalidInput ,  "TTL must be less than 256" ) ) ; 
373+             return  Err ( io:: const_error! ( io:: ErrorKind :: InvalidInput ,  "TTL must be less than 256" ) ) ; 
374374        } 
375375        crate :: os:: xous:: ffi:: blocking_scalar ( 
376376            services:: net_server ( ) , 
377377            services:: NetBlockingScalar :: StdSetTtlTcp ( self . fd ,  ttl) . into ( ) , 
378378        ) 
379-         . or ( Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  & "Unexpected return value" ) ) ) 
379+         . or ( Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  "Unexpected return value" ) ) ) 
380380        . map ( |_| ( ) ) 
381381    } 
382382
@@ -385,7 +385,7 @@ impl TcpStream {
385385            services:: net_server ( ) , 
386386            services:: NetBlockingScalar :: StdGetTtlTcp ( self . fd ) . into ( ) , 
387387        ) 
388-         . or ( Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  & "Unexpected return value" ) ) ) 
388+         . or ( Err ( io:: const_error!( io:: ErrorKind :: InvalidInput ,  "Unexpected return value" ) ) ) 
389389        . map ( |res| res[ 0 ]  as  _ ) ?) 
390390    } 
391391
0 commit comments