Skip to content

Commit

Permalink
style: minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzofelletti committed Jul 9, 2024
1 parent 21dcd16 commit b50abab
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "psp-net"
version = "0.5.3"
version = "0.5.4"
edition = "2021"
license-file = "LICENSE"
keywords = ["psp", "net", "networking", "embedded", "gamedev"]
Expand Down
2 changes: 1 addition & 1 deletion src/socket/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl TcpSocket {
self.send_flags.as_i32(),
)
};
if (result as i32) < 0 {
if result < 0 {
Err(SocketError::Errno(unsafe { sys::sceNetInetGetErrno() }))
} else {
self.buffer.shift_left_buffer(result as usize);
Expand Down
1 change: 0 additions & 1 deletion src/socket/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pub struct TlsSocket<'a> {
tls_connection: TlsConnection<'a, TcpSocket, Aes128GcmSha256>,
/// The TLS config
tls_config: TlsConfig<'a, Aes128GcmSha256>,
// certificate: Option<Certificate<'a>>,
}

impl<'a> TlsSocket<'a> {
Expand Down
8 changes: 4 additions & 4 deletions src/socket/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl UdpSocket {
self.recv_flags.as_i32(),
)
};
if (result as i32) < 0 {
if result < 0 {
Err(SocketError::Errno(unsafe { sys::sceNetInetGetErrno() }))
} else {
Ok(result as usize)
Expand Down Expand Up @@ -220,7 +220,7 @@ impl UdpSocket {
&mut Self::socket_len(),
)
};
if (result as i32) < 0 {
if result < 0 {
Err(SocketError::Errno(unsafe { sys::sceNetInetGetErrno() }))
} else {
Ok(result as usize)
Expand Down Expand Up @@ -268,7 +268,7 @@ impl UdpSocket {
socklen,
)
};
if (result as i32) < 0 {
if result < 0 {
Err(SocketError::Errno(unsafe { sys::sceNetInetGetErrno() }))
} else {
self.buffer.shift_left_buffer(result as usize);
Expand Down Expand Up @@ -321,7 +321,7 @@ impl UdpSocket {
self.send_flags.as_i32(),
)
};
if (result as i32) < 0 {
if result < 0 {
Err(SocketError::Errno(unsafe { sys::sceNetInetGetErrno() }))
} else {
self.buffer.shift_left_buffer(result as usize);
Expand Down

0 comments on commit b50abab

Please sign in to comment.