feat: with as ref as well
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
6ec6844ebb
commit
c0fe864923
@ -43,22 +43,26 @@ impl CuddleCI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_pull_request<T>(&mut self, pr: T) -> &mut Self
|
pub fn with_pull_request<T>(&mut self, pr: impl AsRef<T>) -> &mut Self
|
||||||
where
|
where
|
||||||
T: PullRequestAction + ToOwned + Send + Sync + 'static,
|
T: PullRequestAction + ToOwned + Send + Sync + 'static,
|
||||||
T: ToOwned<Owned = T>,
|
T: ToOwned<Owned = T>,
|
||||||
{
|
{
|
||||||
|
let pr = pr.as_ref();
|
||||||
|
|
||||||
self.pr_action.push(Box::new(pr.to_owned()));
|
self.pr_action.push(Box::new(pr.to_owned()));
|
||||||
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_main<T>(&mut self, main: T) -> &mut Self
|
pub fn with_main<T>(&mut self, main: impl AsRef<T>) -> &mut Self
|
||||||
where
|
where
|
||||||
T: MainAction + Send + Sync + 'static,
|
T: MainAction + Send + Sync + 'static,
|
||||||
T: ToOwned<Owned = T>,
|
T: ToOwned<Owned = T>,
|
||||||
{
|
{
|
||||||
self.main_action.push(Box::new(main));
|
let main = main.as_ref();
|
||||||
|
|
||||||
|
self.main_action.push(Box::new(main.to_owned()));
|
||||||
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user