feat: use generics
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-03-30 23:12:05 +01:00
parent c38062bb46
commit 20ea9fd3c6
Signed by: kjuulh
GPG Key ID: 9AA7BC13CE474394

View File

@ -45,17 +45,17 @@ impl CuddleCI {
}
}
pub fn with_pull_request(
pub fn with_pull_request<T: PullRequestAction + Send + Sync + 'static>(
&mut self,
pr: Arc<Mutex<dyn PullRequestAction + Send + Sync>>,
pr: T,
) -> &mut Self {
self.pr_action.push(pr);
self.pr_action.push(Arc::new(Mutex::new(pr)));
self
}
pub fn with_main(&mut self, main: Arc<Mutex<dyn MainAction + Send + Sync>>) -> &mut Self {
self.main_action.push(main);
pub fn with_main<T: MainAction + Send + Sync + 'static>(&mut self, main: T) -> &mut Self {
self.main_action.push(Arc::new(Mutex::new(main)));
self
}