Skip to content

Commit

Permalink
Make ParamSpec::new_parts public
Browse files Browse the repository at this point in the history
Reviewed By: IanChilds

Differential Revision: D63437258

fbshipit-source-id: 686caa10b6fdd0f09cc57216804f46e64667423a
  • Loading branch information
stepancheg authored and facebook-github-bot committed Sep 26, 2024
1 parent 911e287 commit 3f80c26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions starlark/src/typing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ mod tests;
pub use basic::TyBasic;
pub use callable::TyCallable;
pub use callable_param::Param;
pub use callable_param::ParamIsRequired;
pub use callable_param::ParamSpec;
pub use function::TyFunction;
pub use interface::Interface;
Expand Down
8 changes: 6 additions & 2 deletions starlark/src/typing/callable_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ use crate::typing::small_arc_vec_or_static::SmallArcVec1OrStatic;
use crate::typing::Ty;
use crate::util::arc_str::ArcStr;

/// Indication whether parameter is required.
#[derive(
Debug, Clone, Dupe, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Allocative
)]
pub(crate) enum ParamIsRequired {
pub enum ParamIsRequired {
/// Parameter is required.
Yes,
/// Parameter is optional.
No,
}

Expand Down Expand Up @@ -337,7 +340,8 @@ impl ParamSpec {
}
}

pub(crate) fn new_parts(
/// Create a new parameter specification from different parameter kinds in order.
pub fn new_parts(
pos_only: impl IntoIterator<Item = (ParamIsRequired, Ty)>,
pos_or_name: impl IntoIterator<Item = (ArcStr, ParamIsRequired, Ty)>,
args: Option<Ty>,
Expand Down

0 comments on commit 3f80c26

Please sign in to comment.