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

docs(rust): Fix inconsistency between code and comment #20070

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions crates/polars-arrow/src/array/utf8/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ impl<O: Offset> Utf8Array<O> {
///
/// # Errors
/// This function returns an error iff:
/// * The last offset is not equal to the values' length.
/// * the validity's length is not equal to `offsets.len()`.
/// * The last offset is greater than the values' length.
/// * the validity's length is not equal to `offsets.len_proxy()`.
/// * The `dtype`'s [`crate::datatypes::PhysicalType`] is not equal to either `Utf8` or `LargeUtf8`.
/// * The `values` between two consecutive `offsets` are not valid utf8
/// # Implementation
Expand Down Expand Up @@ -354,8 +354,8 @@ impl<O: Offset> Utf8Array<O> {
///
/// # Panic
/// This function panics (in debug mode only) iff:
/// * The last offset is not equal to the values' length.
/// * the validity's length is not equal to `offsets.len()`.
/// * The last offset is greater than the values' length.
/// * the validity's length is not equal to `offsets.len_proxy()`.
/// * The `dtype`'s [`crate::datatypes::PhysicalType`] is not equal to either `Utf8` or `LargeUtf8`.
///
/// # Safety
Expand Down Expand Up @@ -395,8 +395,8 @@ impl<O: Offset> Utf8Array<O> {
/// Creates a new [`Utf8Array`].
/// # Panics
/// This function panics iff:
/// * The last offset is not equal to the values' length.
/// * the validity's length is not equal to `offsets.len()`.
/// * The last offset is greater than the values' length.
/// * the validity's length is not equal to `offsets.len_proxy()`.
/// * The `dtype`'s [`crate::datatypes::PhysicalType`] is not equal to either `Utf8` or `LargeUtf8`.
/// * The `values` between two consecutive `offsets` are not valid utf8
/// # Implementation
Expand Down
6 changes: 3 additions & 3 deletions crates/polars-arrow/src/offset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ impl<O: Offset> Offsets<O> {

/// Returns a range (start, end) corresponding to the position `index`
/// # Panic
/// This function panics iff `index >= self.len()`
/// This function panics iff `index >= self.len_proxy()`
#[inline]
pub fn start_end(&self, index: usize) -> (usize, usize) {
// soundness: the invariant of the function
Expand Down Expand Up @@ -458,7 +458,7 @@ impl<O: Offset> OffsetsBuffer<O> {

/// Returns a `length` corresponding to the position `index`
/// # Panic
/// This function panics iff `index >= self.len()`
/// This function panics iff `index >= self.len_proxy()`
#[inline]
pub fn length_at(&self, index: usize) -> usize {
let (start, end) = self.start_end(index);
Expand All @@ -467,7 +467,7 @@ impl<O: Offset> OffsetsBuffer<O> {

/// Returns a range (start, end) corresponding to the position `index`
/// # Panic
/// This function panics iff `index >= self.len()`
/// This function panics iff `index >= self.len_proxy()`
#[inline]
pub fn start_end(&self, index: usize) -> (usize, usize) {
// soundness: the invariant of the function
Expand Down