diff --git a/src/extensions/hooks/startup.rs b/src/extensions/hooks/startup.rs index 17a451df..4deaf531 100644 --- a/src/extensions/hooks/startup.rs +++ b/src/extensions/hooks/startup.rs @@ -14,12 +14,17 @@ pub struct SpawnOnStartup { } impl SpawnOnStartup { + /// Create a new unboxed startup hook ready for adding to your Config + pub fn new(prog: impl Into>) -> Self { + Self { prog: prog.into() } + } + /// Create a new startup hook ready for adding to your Config pub fn boxed(prog: impl Into>) -> Box> where X: XConn, { - Box::new(Self { prog: prog.into() }) + Box::new(Self::new(prog)) } }