Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take vs Into in function names #4668

Closed
sffc opened this issue Mar 8, 2024 · 2 comments · Fixed by #5723
Closed

Take vs Into in function names #4668

sffc opened this issue Mar 8, 2024 · 2 comments · Fixed by #5723
Labels
C-meta Component: Relating to ICU4X as a whole S-small Size: One afternoon (small bug fix or enhancement)

Comments

@sffc
Copy link
Member

sffc commented Mar 8, 2024

take_* should have &mut self, and into_* should have self. Check for consistency of this.

@sffc sffc added the S-small Size: One afternoon (small bug fix or enhancement) label Mar 8, 2024
@sffc sffc added this to the ICU4X 2.0 milestone Mar 8, 2024
@sffc sffc added this to icu4x 2.0 Mar 8, 2024
@sffc sffc moved this to Unclaimed for sprint in icu4x 2.0 Mar 8, 2024
@sffc sffc added the C-meta Component: Relating to ICU4X as a whole label Mar 8, 2024
@robertbastian robertbastian moved this from Unclaimed for sprint to Small breakage (defer to end) in icu4x 2.0 Mar 19, 2024
@Manishearth
Copy link
Member

utils/zerotrie/src/builder/konst/builder.rs
27:    pub const fn take_or_panic(self) -> [u8; N] {
utils/zerotrie/src/zerotrie.rs
257:            pub fn take_store(self) -> Store {
721:    pub fn take_store(self) -> Store {

utils/resb/src/text/reader/parse_state.rs
69:    pub fn take_keys(self) -> IndexSet<Key<'a>> {
151:    fn take_split(&self, count: usize) -> (Self, Self) {


components/locale_core/src/helpers.rs
102:            pub const fn into_tinystr(&self) -> tinystr::TinyAsciiStr<$len_end> {

@Manishearth
Copy link
Member

take_keys operates on an Rc<RefCell> so it's a real take, just hidden behind immutability. I'm going to make it take &self so that the object can still be reused.

take_split is a trait method.

@github-project-automation github-project-automation bot moved this from Small breakage (defer to end) to Done in icu4x 2.0 Oct 24, 2024
@github-project-automation github-project-automation bot moved this from Small breakage (defer to end) to Done in icu4x 2.0 Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-meta Component: Relating to ICU4X as a whole S-small Size: One afternoon (small bug fix or enhancement)
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants