Skip to content

Commit

Permalink
feat: add Clone and Copy derives where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
passcod committed Apr 20, 2024
1 parent 3be6070 commit bfd45e0
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/std/creation_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use super::{StdCommandWrap, StdCommandWrapper};
/// It exists to be able to set creation flags on a `Command` and also store them in the wrapper, so
/// that they're no overwritten by other wrappers. Notably this is the only way to use creation
/// flags and the `JobObject` wrapper together.
#[derive(Debug, Clone)]
#[derive(Clone, Copy, Debug)]
pub struct CreationFlags(pub PROCESS_CREATION_FLAGS);

impl StdCommandWrapper for CreationFlags {
Expand Down
2 changes: 1 addition & 1 deletion src/std/job_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use super::{StdChildWrapper, StdCommandWrap, StdCommandWrapper};
/// See [Job Objects](https://docs.microsoft.com/en-us/windows/win32/procthread/job-objects).
///
/// This wrapper provides a child wrapper: [`JobObjectChild`].
#[derive(Debug)]
#[derive(Clone, Copy, Debug)]
pub struct JobObject;

impl StdCommandWrapper for JobObject {
Expand Down
2 changes: 1 addition & 1 deletion src/std/process_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use super::{StdChildWrapper, StdCommandWrap, StdCommandWrapper};
/// placement in foreground or background, among other actions.
///
/// This wrapper provides a child wrapper: [`ProcessGroupChild`].
#[derive(Debug, Clone)]
#[derive(Clone, Copy, Debug)]
pub struct ProcessGroup {
leader: Pid,
}
Expand Down
2 changes: 1 addition & 1 deletion src/std/process_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use super::{StdCommandWrap, StdCommandWrapper};
///
/// This wrapper uses [the same child wrapper as `ProcessGroup`](super::ProcessGroupChild) and does
/// the same setup (plus the session setup); using both together is unnecessary and may misbehave.
#[derive(Debug, Clone)]
#[derive(Clone, Copy, Debug)]
pub struct ProcessSession;

impl StdCommandWrapper for ProcessSession {
Expand Down
2 changes: 1 addition & 1 deletion src/tokio/creation_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use super::{TokioCommandWrap, TokioCommandWrapper};
/// It exists to be able to set creation flags on a `Command` and also store them in the wrapper, so
/// that they're no overwritten by other wrappers. Notably this is the only way to use creation
/// flags and the `JobObject` wrapper together.
#[derive(Debug, Clone)]
#[derive(Clone, Copy, Debug)]
pub struct CreationFlags(pub PROCESS_CREATION_FLAGS);

impl TokioCommandWrapper for CreationFlags {
Expand Down
2 changes: 1 addition & 1 deletion src/tokio/job_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use super::{TokioChildWrapper, TokioCommandWrap, TokioCommandWrapper};
/// See [Job Objects](https://docs.microsoft.com/en-us/windows/win32/procthread/job-objects).
///
/// This wrapper provides a child wrapper: [`JobObjectChild`].
#[derive(Debug)]
#[derive(Clone, Copy, Debug)]
pub struct JobObject;

impl TokioCommandWrapper for JobObject {
Expand Down
2 changes: 1 addition & 1 deletion src/tokio/kill_on_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use super::{TokioCommandWrap, TokioCommandWrapper};
/// This wrapper exists to be able to set the kill-on-drop flag on a `Command` and also store that
/// fact in the wrapper, so that it can be used by other wrappers. Notably this is used by the
/// `JobObject` wrapper.
#[derive(Debug)]
#[derive(Clone, Copy, Debug)]
pub struct KillOnDrop;

impl TokioCommandWrapper for KillOnDrop {
Expand Down
2 changes: 1 addition & 1 deletion src/tokio/process_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use super::{TokioChildWrapper, TokioCommandWrap, TokioCommandWrapper};
/// placement in foreground or background, among other actions.
///
/// This wrapper provides a child wrapper: [`ProcessGroupChild`].
#[derive(Debug, Clone)]
#[derive(Clone, Copy, Debug)]
pub struct ProcessGroup {
leader: Pid,
}
Expand Down
2 changes: 1 addition & 1 deletion src/tokio/process_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use super::{TokioCommandWrap, TokioCommandWrapper};
///
/// This wrapper uses [the same child wrapper as `ProcessGroup`](super::ProcessGroupChild) and does
/// the same setup (plus the session setup); using both together is unnecessary and may misbehave.
#[derive(Debug, Clone)]
#[derive(Clone, Copy, Debug)]
pub struct ProcessSession;

impl TokioCommandWrapper for ProcessSession {
Expand Down

0 comments on commit bfd45e0

Please sign in to comment.