Skip to content

Commit

Permalink
StarlarkCallableChecked::to_unchecked
Browse files Browse the repository at this point in the history
Reviewed By: IanChilds, perehonchuk

Differential Revision: D63677029

fbshipit-source-id: ed4184f649f89543e08a7ea43d99b1a1bada3c76
  • Loading branch information
stepancheg authored and facebook-github-bot committed Oct 1, 2024
1 parent f08ec19 commit 6619188
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions starlark/src/values/typing/callable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,13 @@ pub struct StarlarkCallableChecked<'v, P: StarlarkCallableParamSpec, R: Starlark
PhantomData<AtomicPtr<(P, R)>>,
);

impl<'v, P: StarlarkCallableParamSpec, R: StarlarkTypeRepr> StarlarkCallableChecked<'v, P, R> {
/// Convert to [`StarlarkCallable`].
pub fn to_unchecked(self) -> StarlarkCallable<'v, P, R> {
StarlarkCallable::unchecked_new(self.0)
}
}

impl<'v, P: StarlarkCallableParamSpec, R: StarlarkTypeRepr> StarlarkTypeRepr
for StarlarkCallableChecked<'v, P, R>
{
Expand Down

0 comments on commit 6619188

Please sign in to comment.