Skip to content

Commit

Permalink
Move methods next to types
Browse files Browse the repository at this point in the history
Summary: Re D59118052.

Reviewed By: JakobDegen

Differential Revision: D63004718

fbshipit-source-id: 7445cf69d0c8463e2b0e94d93d46c6d2f4fd76cf
  • Loading branch information
stepancheg authored and facebook-github-bot committed Sep 19, 2024
1 parent 8b9ac32 commit 6ab7742
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 6 deletions.
3 changes: 0 additions & 3 deletions starlark/src/stdlib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,11 @@ use crate::environment::GlobalsBuilder;

pub(crate) mod breakpoint;
pub(crate) mod call_stack;
pub(crate) mod dict;
pub(crate) mod extra;
mod funcs;
pub(crate) mod internal;
pub(crate) mod json;
pub(crate) mod list;
pub(crate) mod partial;
pub(crate) mod string;
pub(crate) mod structs;

pub use extra::PrintHandler;
Expand Down
1 change: 1 addition & 0 deletions starlark/src/values/types/dict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
mod alloc;

mod dict_type;
pub(crate) mod methods;
pub(crate) mod refcell;
mod refs;
mod traits;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion starlark/src/values/types/dict/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ impl<'v> DictLike<'v> for FrozenDictData {

pub(crate) fn dict_methods() -> Option<&'static Methods> {
static RES: MethodsStatic = MethodsStatic::new();
RES.methods(crate::stdlib::dict::dict_methods)
RES.methods(crate::values::types::dict::methods::dict_methods)
}

#[starlark_value(type = Dict::TYPE)]
Expand Down
1 change: 1 addition & 0 deletions starlark/src/values/types/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
pub(crate) mod alloc;
mod list_type;
pub(crate) mod methods;
mod refs;
pub(crate) mod unpack;
pub(crate) mod value;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion starlark/src/values/types/list/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ pub(crate) fn display_list(xs: &[Value], f: &mut fmt::Formatter<'_>) -> fmt::Res

pub(crate) fn list_methods() -> Option<&'static Methods> {
static RES: MethodsStatic = MethodsStatic::new();
RES.methods(crate::stdlib::list::list_methods)
RES.methods(crate::values::types::list::methods::list_methods)
}

#[starlark_value(type = ListData::TYPE)]
Expand Down
1 change: 1 addition & 0 deletions starlark/src/values/types/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub(crate) mod dot_format;
pub(crate) mod intern;
pub(crate) mod interpolation;
pub(crate) mod iter;
pub(crate) mod methods;
pub(crate) mod repr;
pub(crate) mod simd;
pub(crate) mod str_type;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion starlark/src/values/types/string/str_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl Display for StarlarkStr {

pub(crate) fn str_methods() -> Option<&'static Methods> {
static RES: MethodsStatic = MethodsStatic::new();
RES.methods(crate::stdlib::string::string_methods)
RES.methods(crate::values::types::string::methods::string_methods)
}

#[starlark_value(type = STRING_TYPE)]
Expand Down

0 comments on commit 6ab7742

Please sign in to comment.