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

len is not a parameter of MutableArrayData::extend #1316

Closed
HaoYang670 opened this issue Feb 16, 2022 · 1 comment · Fixed by #1336
Closed

len is not a parameter of MutableArrayData::extend #1316

HaoYang670 opened this issue Feb 16, 2022 · 1 comment · Fixed by #1336
Labels
bug documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@HaoYang670
Copy link
Contributor

HaoYang670 commented Feb 16, 2022

Describe the bug
Noticed while working on #1230 .
The document of MutableArrayData::extend contains a weird value len which is not a parameter of this function.

image

To Reproduce
Steps to reproduce the behavior:

Expected behavior
Replace len by end - start in the document, or change the function's API

Additional context

    /// Extends this [MutableArrayData] with elements from the bounded [ArrayData] at `start`
    /// and for a size of `len`.
    /// # Panic
    /// This function panics if the range is out of bounds, i.e. if `start + len >= array.len()`.
    pub fn extend(&mut self, index: usize, start: usize, end: usize) {
        let len = end - start;
        (self.extend_null_bits[index])(&mut self.data, start, len);
        (self.extend_values[index])(&mut self.data, index, start, len);
        self.data.len += len;
    }
@HaoYang670 HaoYang670 added the bug label Feb 16, 2022
@alamb alamb added documentation Improvements or additions to documentation good first issue Good for newcomers labels Feb 17, 2022
@alamb
Copy link
Contributor

alamb commented Feb 17, 2022

I think fixing the doc comment would be the best approach here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants