Skip to content

Commit

Permalink
Implement Clone, Copy for NestedSubsystem
Browse files Browse the repository at this point in the history
  • Loading branch information
9999years committed Sep 22, 2023
1 parent 15bfcb0 commit 5de2521
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/subsystem/identifier.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::atomic::{AtomicUsize, Ordering};

#[derive(PartialEq, Eq, Debug, Clone)]
#[derive(PartialEq, Eq, Debug, Clone, Copy)]
pub struct SubsystemIdentifier {
id: usize,
}
Expand All @@ -22,7 +22,7 @@ mod tests {
#[test]
fn equals_with_itself() {
let identifier1 = SubsystemIdentifier::create();
#[allow(clippy::redundant_clone)]
#[allow(clippy::clone_on_copy)]
let identifier2 = identifier1.clone();
assert_eq!(identifier1, identifier2);
}
Expand Down
1 change: 1 addition & 0 deletions src/subsystem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ struct SubsystemDescriptor<ErrType: ErrTypeTraits = crate::BoxedError> {
/// A nested subsystem. Can be used to perform a partial shutdown.
///
/// For more information, see [`SubsystemHandle::start()`] and [`SubsystemHandle::perform_partial_shutdown()`].
#[derive(PartialEq, Eq, Debug, Clone, Copy)]
pub struct NestedSubsystem {
id: SubsystemIdentifier,
}

0 comments on commit 5de2521

Please sign in to comment.