@@ -41,25 +41,25 @@ impl Setup {
4141 } )
4242 }
4343 /// Construct a new IPv4 target parameter using the address and port. It
44- /// will return `BadParameters` if the address contains a `\0` character in
44+ /// will return `BadParameters` if the address contains a `\0` character in
4545 /// the middle.
4646 pub fn new_v4 ( addr : & str , port : u16 ) -> crate :: Result < Self > {
4747 Self :: new ( addr, port, raw:: TEE_ipSocket_ipVersion :: TEE_IP_VERSION_4 )
4848 }
4949 /// Construct a new IPv6 target parameter using the address and port. It
50- /// will return `BadParameters` if the address contains a `\0` character in
50+ /// will return `BadParameters` if the address contains a `\0` character in
5151 /// the middle.
5252 pub fn new_v6 ( addr : & str , port : u16 ) -> crate :: Result < Self > {
5353 Self :: new ( addr, port, raw:: TEE_ipSocket_ipVersion :: TEE_IP_VERSION_6 )
5454 }
5555}
5656
57- /// An adapter for TCP sockets in OP-TEE. Typically, it is not used directly,
58- /// but can be employed for wrapper operations, such as traffic control within
57+ /// An adapter for TCP sockets in OP-TEE. Typically, it is not used directly,
58+ /// but can be employed for wrapper operations, such as traffic control within
5959/// the TEE.
6060pub struct TcpAdapter ( raw:: TEE_iSocketHandle ) ;
61- /// An adapter for UDP sockets in OP-TEE. Typically, it is not used directly,
62- /// but can be employed for wrapper operations, such as traffic control within
61+ /// An adapter for UDP sockets in OP-TEE. Typically, it is not used directly,
62+ /// but can be employed for wrapper operations, such as traffic control within
6363/// the TEE.
6464pub struct UdpAdapter ( raw:: TEE_iSocketHandle ) ;
6565/// A TcpStream that is compatible with OP-TEE.
@@ -108,12 +108,7 @@ impl SocketAdapter for TcpAdapter {
108108 fn send ( handle : & mut Self :: Handle , buf : & [ u8 ] , timeout : u32 ) -> Result < usize , SocketError > {
109109 let mut length: u32 = buf. len ( ) as _ ;
110110 let ret = unsafe {
111- ( ( * raw:: TEE_tcpSocket ) . send ) (
112- handle. 0 ,
113- buf. as_ptr ( ) as _ ,
114- & mut length,
115- timeout,
116- )
111+ ( ( * raw:: TEE_tcpSocket ) . send ) ( handle. 0 , buf. as_ptr ( ) as _ , & mut length, timeout)
117112 } ;
118113 match ret {
119114 raw:: TEE_SUCCESS => Ok ( length as usize ) ,
@@ -168,12 +163,7 @@ impl SocketAdapter for UdpAdapter {
168163 fn send ( handle : & mut Self :: Handle , buf : & [ u8 ] , timeout : u32 ) -> Result < usize , SocketError > {
169164 let mut length: u32 = buf. len ( ) as _ ;
170165 let ret = unsafe {
171- ( ( * raw:: TEE_udpSocket ) . send ) (
172- handle. 0 ,
173- buf. as_ptr ( ) as _ ,
174- & mut length,
175- timeout,
176- )
166+ ( ( * raw:: TEE_udpSocket ) . send ) ( handle. 0 , buf. as_ptr ( ) as _ , & mut length, timeout)
177167 } ;
178168 match ret {
179169 raw:: TEE_SUCCESS => Ok ( length as usize ) ,
0 commit comments