Skip to content

Commit d5e47d7

Browse files
Alexandra Iordacheandreeaflorescu
authored andcommitted
Fix clippy warnings
Implement `Eq` for the `Error` type and add safety comments where missing, preceding unsafe blocks. Signed-off-by: Alexandra Iordache <[email protected]> fsjksk
1 parent 92a7859 commit d5e47d7

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# [Unreleased]
2+
3+
## Added
4+
5+
- The `Error` type now implements `Eq`.
6+
17
# v0.2.1
28

39
## Changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ mod endpoint;
3232
pub use endpoint::RemoteEndpoint;
3333

3434
/// Error conditions that may appear during `EventManager` related operations.
35-
#[derive(Debug, PartialEq)]
35+
#[derive(Debug, Eq, PartialEq)]
3636
pub enum Error {
3737
#[cfg(feature = "remote_endpoint")]
3838
/// Cannot send message on channel.

tests/negative_tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ fn test_handling_errors_in_subscriber() {
6363
let subscriber = Arc::new(UnixStreamSubscriber::new(sock1));
6464
event_manager.add_subscriber(subscriber.clone());
6565

66+
// SAFETY: safe because `sock2` is a valid Unix socket, as asserted by the `unwrap` above.
6667
unsafe { libc::close(sock2.as_raw_fd()) };
6768

6869
event_manager.run_with_timeout(100).unwrap();
@@ -79,6 +80,7 @@ fn test_handling_errors_in_subscriber() {
7980
Arc::new(UnixStreamSubscriber::new_with_unregister_on_err(sock1));
8081
event_manager.add_subscriber(subscriber_with_unregister);
8182

83+
// SAFETY: safe because `sock2` is a valid Unix socket, as asserted by the `unwrap` above.
8284
unsafe { libc::close(sock2.as_raw_fd()) };
8385

8486
let ready_list_len = event_manager.run_with_timeout(100).unwrap();

0 commit comments

Comments
 (0)