Repository: apache/arrow-rs
Pull request #6116 (2024-07-25 17:34:08)

Fix Clippy for the Rust 1.80 release
# Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->

Closes https://github.com/apache/arrow-rs/issues/6114

# Rationale for this change
 
Rust 1.80 added a bunch of new lints which our codebase fails. Thus let's fix them

# What changes are included in this PR?

<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->

# Are there any user-facing changes?


<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->

<!---
If there are any breaking changes to public APIs, please add the `breaking change` label.
-->



Patch:
diff --git a/arrow-array/Cargo.toml b/arrow-array/Cargo.toml
index 7c989fe4d..6170db85d 100644
--- a/arrow-array/Cargo.toml
+++ b/arrow-array/Cargo.toml
@@ -52,6 +52,7 @@ hashbrown = { version = "0.14.2", default-features = false }
 
 [features]
 ffi = ["arrow-schema/ffi", "arrow-data/ffi"]
+force_validate = []
 
 [dev-dependencies]
 rand = { version = "0.8", default-features = false, features = ["std", "std_rng"] }
diff --git a/arrow-array/src/array/byte_view_array.rs b/arrow-array/src/array/byte_view_array.rs
index bd8c0cebc..63b9fe30e 100644
--- a/arrow-array/src/array/byte_view_array.rs
+++ b/arrow-array/src/array/byte_view_array.rs
@@ -66,7 +66,7 @@ use super::ByteArrayType;
 /// * Strings with length <= 12 are stored directly in the view.
 ///
 /// * Strings with length > 12: The first four bytes are stored inline in the
-/// view and the entire string is stored in one of the buffers.
+///   view and the entire string is stored in one of the buffers.
 ///
 /// Unlike [`GenericByteArray`], there are no constraints on the offsets other
 /// than they must point into a valid buffer. However, they can be out of order,
diff --git a/arrow-array/src/array/string_array.rs b/arrow-array/src/array/string_array.rs
index 9d266e0ca..4722de55d 100644
--- a/arrow-array/src/array/string_array.rs
+++ b/arrow-array/src/array/string_array.rs
@@ -376,70 +376,6 @@ mod tests {
             .expect("All null array has valid array data");
     }
 
-    #[cfg(feature = "test_utils")]
-    #[test]
-    fn bad_size_collect_string() {
-        use crate::util::test_util::BadIterator;
-        let data = vec![Some("foo"), None, Some("bar")];
-        let expected: StringArray = data.clone().into_iter().collect();
-
-        // Iterator reports too many items
-        let arr: StringArray = BadIterator::new(3, 10, data.clone()).collect();
-        assert_eq!(expected, arr);
-
-        // Iterator reports too few items
-        let arr: StringArray = BadIterator::new(3, 1, data.clone()).collect();
-        assert_eq!(expected, arr);
-    }
-
-    #[cfg(feature = "test_utils")]
-    #[test]
-    fn bad_size_collect_large_string() {
-        use crate::util::test_util::BadIterator;
-        let data = vec![Some("foo"), None, Some("bar")];
-        let expected: LargeStringArray = data.clone().into_iter().collect();
-
-        // Iterator reports too many items
-        let arr: LargeStringArray = BadIterator::new(3, 10, data.clone()).collect();
-        assert_eq!(expected, arr);
-
-        // Iterator reports too few items
-        let arr: LargeStringArray = BadIterator::new(3, 1, data.clone()).collect();
-        assert_eq!(expected, arr);
-    }
-
-    #[cfg(feature = "test_utils")]
-    #[test]
-    fn bad_size_iter_values_string() {
-        use crate::util::test_util::BadIterator;
-        let data = vec!["foo", "bar", "baz"];
-        let expected: StringArray = data.clone().into_iter().map(Some).collect();
-
-        // Iterator reports too many items
-        let arr = StringArray::from_iter_values(BadIterator::new(3, 10, data.clone()));
-        assert_eq!(expected, arr);
-
-        // Iterator reports too few items
-        let arr = StringArray::from_iter_values(BadIterator::new(3, 1, data.clone()));
-        assert_eq!(expected, arr);
-    }
-
-    #[cfg(feature = "test_utils")]
-    #[test]
-    fn bad_size_iter_values_large_string() {
-        use crate::util::test_util::BadIterator;
-        let data = vec!["foo", "bar", "baz"];
-        let expected: LargeStringArray = data.clone().into_iter().map(Some).collect();
-
-        // Iterator reports too many items
-        let arr = LargeStringArray::from_iter_values(BadIterator::new(3, 10, data.clone()));
-        assert_eq!(expected, arr);
-
-        // Iterator reports too few items
-        let arr = LargeStringArray::from_iter_values(BadIterator::new(3, 1, data.clone()));
-        assert_eq!(expected, arr);
-    }
-
     fn _test_generic_string_array_from_list_array<O: OffsetSizeTrait>() {
         let values = b"HelloArrowAndParquet";
         // "ArrowAndParquet"
diff --git a/arrow-cast/Cargo.toml b/arrow-cast/Cargo.toml
index 791b129b2..86f1a431a 100644
--- a/arrow-cast/Cargo.toml
+++ b/arrow-cast/Cargo.toml
@@ -38,6 +38,7 @@ features = ["prettyprint"]
 
 [features]
 prettyprint = ["comfy-table"]
+force_validate = []
 
 [dependencies]
 arrow-array = { workspace = true }
diff --git a/arrow-cast/src/cast/mod.rs b/arrow-cast/src/cast/mod.rs
index 1770157bc..4dd695962 100644
--- a/arrow-cast/src/cast/mod.rs
+++ b/arrow-cast/src/cast/mod.rs
@@ -568,28 +568,27 @@ fn timestamp_to_date32<T: ArrowTimestampType>(
 /// Accepts [`CastOptions`] to specify cast behavior. See also [`cast()`].
 ///
 /// # Behavior
-/// * Boolean to Utf8: `true` => '1', `false` => `0`
-/// * Utf8 to boolean: `true`, `yes`, `on`, `1` => `true`, `false`, `no`, `off`, `0` => `false`,
+/// * `Boolean` to `Utf8`: `true` => '1', `false` => `0`
+/// * `Utf8` to `Boolean`: `true`, `yes`, `on`, `1` => `true`, `false`, `no`, `off`, `0` => `false`,
 ///   short variants are accepted, other strings return null or error
-/// * Utf8 to numeric: strings that can't be parsed to numbers return null, float strings
+/// * `Utf8` to Numeric: strings that can't be parsed to numbers return null, float strings
 ///   in integer casts return null
-/// * Numeric to boolean: 0 returns `false`, any other value returns `true`
-/// * List to List: the underlying data type is cast
-/// * List to FixedSizeList: the underlying data type is cast. If safe is true and a list element
-/// has the wrong length it will be replaced with NULL, otherwise an error will be returned
-/// * Primitive to List: a list array with 1 value per slot is created
-/// * Date32 and Date64: precision lost when going to higher interval
-/// * Time32 and Time64: precision lost when going to higher interval
-/// * Timestamp and Date{32|64}: precision lost when going to higher interval
-/// * Temporal to/from backing primitive: zero-copy with data type change
-/// * Casting from `float32/float64` to `Decimal(precision, scale)` rounds to the `scale` decimals
-///   (i.e. casting `6.4999` to Decimal(10, 1) becomes `6.5`). Prior to  version `26.0.0`,
-///   casting would truncate instead (i.e. outputs `6.4` instead)
+/// * Numeric to `Boolean`: 0 returns `false`, any other value returns `true`
+/// * `List` to `List`: the underlying data type is cast
+/// * `List` to `FixedSizeList`: the underlying data type is cast. If safe is true and a list element
+///   has the wrong length it will be replaced with NULL, otherwise an error will be returned
+/// * Primitive to `List`: a list array with 1 value per slot is created
+/// * `Date32` and `Date64`: precision lost when going to higher interval
+/// * `Time32 and `Time64`: precision lost when going to higher interval
+/// * `Timestamp` and `Date{32|64}`: precision lost when going to higher interval
+/// * Temporal to/from backing Primitive: zero-copy with data type change
+/// * `Float32/Float64` to `Decimal(precision, scale)` rounds to the `scale` decimals
+///   (i.e. casting `6.4999` to `Decimal(10, 1)` becomes `6.5`).
 ///
 /// Unsupported Casts (check with `can_cast_types` before calling):
 /// * To or from `StructArray`
-/// * List to primitive
-/// * Interval and duration
+/// * `List` to `Primitive`
+/// * `Interval` and `Duration`
 ///
 /// # Timestamps and Timezones
 ///
diff --git a/arrow-cast/src/parse.rs b/arrow-cast/src/parse.rs
index 427672a6a..65cb5f542 100644
--- a/arrow-cast/src/parse.rs
+++ b/arrow-cast/src/parse.rs
@@ -285,12 +285,12 @@ fn to_timestamp_nanos(dt: NaiveDateTime) -> Result<i64, ArrowError> {
 /// variants and converts it to nanoseconds since midnight.
 ///
 /// Examples of accepted inputs:
+///
 /// * `09:26:56.123 AM`
 /// * `23:59:59`
 /// * `6:00 pm`
-//
-/// Internally, this function uses the `chrono` library for the
-/// time parsing
+///
+/// Internally, this function uses the `chrono` library for the time parsing
 ///
 /// ## Timezone / Offset Handling
 ///
diff --git a/arrow-data/src/data.rs b/arrow-data/src/data.rs
index d6d6b90b6..a14bc4873 100644
--- a/arrow-data/src/data.rs
+++ b/arrow-data/src/data.rs
@@ -1179,8 +1179,10 @@ impl ArrayData {
     ///
     /// Does not (yet) check
     /// 1. Union type_ids are valid see [#85](https://github.com/apache/arrow-rs/issues/85)
-    /// Validates the the null count is correct and that any
-    /// nullability requirements of its children are correct
+    /// 2. the the null count is correct and that any
+    /// 3. nullability requirements of its children are correct
+    ///
+    /// [#85]: https://github.com/apache/arrow-rs/issues/85
     pub fn validate_nulls(&self) -> Result<(), ArrowError> {
         if let Some(nulls) = &self.nulls {
             let actual = nulls.len() - nulls.inner().count_set_bits();
diff --git a/arrow-data/src/equal/mod.rs b/arrow-data/src/equal/mod.rs
index dba6a0186..f24179b61 100644
--- a/arrow-data/src/equal/mod.rs
+++ b/arrow-data/src/equal/mod.rs
@@ -138,17 +138,24 @@ fn equal_range(
 }
 
 /// Logically compares two [ArrayData].
+///
 /// Two arrays are logically equal if and only if:
 /// * their data types are equal
 /// * their lengths are equal
 /// * their null counts are equal
 /// * their null bitmaps are equal
 /// * each of their items are equal
-/// two items are equal when their in-memory representation is physically equal (i.e. same bit content).
+///
+/// Two items are equal when their in-memory representation is physically equal
+/// (i.e. has the same bit content).
+///
 /// The physical comparison depend on the data type.
+///
 /// # Panics
-/// This function may panic whenever any of the [ArrayData] does not follow the Arrow specification.
-/// (e.g. wrong number of buffers, buffer `len` does not correspond to the declared `len`)
+///
+/// This function may panic whenever any of the [ArrayData] does not follow the
+/// Arrow specification. (e.g. wrong number of buffers, buffer `len` does not
+/// correspond to the declared `len`)
 pub fn equal(lhs: &ArrayData, rhs: &ArrayData) -> bool {
     utils::base_equal(lhs, rhs)
         && lhs.null_count() == rhs.null_count()
diff --git a/arrow-flight/src/decode.rs b/arrow-flight/src/decode.rs
index afbf033eb..5561f256c 100644
--- a/arrow-flight/src/decode.rs
+++ b/arrow-flight/src/decode.rs
@@ -225,8 +225,8 @@ impl futures::Stream for FlightRecordBatchStream {
 /// Example usecases
 ///
 /// 1. Using this low level stream it is possible to receive a steam
-/// of RecordBatches in FlightData that have different schemas by
-/// handling multiple schema messages separately.
+///    of RecordBatches in FlightData that have different schemas by
+///    handling multiple schema messages separately.
 pub struct FlightDataDecoder {
     /// Underlying data stream
     response: BoxStream<'static, Result<FlightData>>,
diff --git a/arrow-flight/src/encode.rs b/arrow-flight/src/encode.rs
index e7722fd7f..59fa8afd5 100644
--- a/arrow-flight/src/encode.rs
+++ b/arrow-flight/src/encode.rs
@@ -38,11 +38,14 @@ use futures::{ready, stream::BoxStream, Stream, StreamExt};
 /// several have already been successfully produced.
 ///
 /// # Caveats
-///   1. When [`DictionaryHandling`] is [`DictionaryHandling::Hydrate`], [`DictionaryArray`](arrow_array::array::DictionaryArray)s
-///   are converted to their underlying types prior to transport.
-///   When [`DictionaryHandling`] is [`DictionaryHandling::Resend`], Dictionary [`FlightData`] is sent with every
-///   [`RecordBatch`] that contains a [`DictionaryArray`](arrow_array::array::DictionaryArray).
-///   See <https://github.com/apache/arrow-rs/issues/3389>.
+/// 1. When [`DictionaryHandling`] is [`DictionaryHandling::Hydrate`],
+///    [`DictionaryArray`]s are converted to their underlying types prior to
+///    transport.
+///    When [`DictionaryHandling`] is [`DictionaryHandling::Resend`], Dictionary [`FlightData`] is sent with every
+///    [`RecordBatch`] that contains a [`DictionaryArray`](arrow_array::array::DictionaryArray).
+///    See <https://github.com/apache/arrow-rs/issues/3389>.
+///
+/// [`DictionaryArray`]: arrow_array::array::DictionaryArray
 ///
 /// # Example
 /// ```no_run
diff --git a/arrow-flight/src/lib.rs b/arrow-flight/src/lib.rs
index a4b4ab7bc..8fa61b1d5 100644
--- a/arrow-flight/src/lib.rs
+++ b/arrow-flight/src/lib.rs
@@ -26,14 +26,14 @@
 //! This crate contains:
 //!
 //! 1. Low level [prost] generated structs
-//!  for Flight gRPC protobuf messages, such as [`FlightData`], [`FlightInfo`],
-//!  [`Location`] and [`Ticket`].
+//!    for Flight gRPC protobuf messages, such as [`FlightData`], [`FlightInfo`],
+//!    [`Location`] and [`Ticket`].
 //!
 //! 2. Low level [tonic] generated [`flight_service_client`] and
-//! [`flight_service_server`].
+//!    [`flight_service_server`].
 //!
 //! 3. Experimental support for [Flight SQL] in [`sql`]. Requires the
-//! `flight-sql-experimental` feature of this crate to be activated.
+//!    `flight-sql-experimental` feature of this crate to be activated.
 //!
 //! [Flight SQL]: https://arrow.apache.org/docs/format/FlightSql.html
 #![allow(rustdoc::invalid_html_tags)]
diff --git a/arrow-select/src/concat.rs b/arrow-select/src/concat.rs
index 5732d721b..ca6d0ac1f 100644
--- a/arrow-select/src/concat.rs
+++ b/arrow-select/src/concat.rs
@@ -612,13 +612,13 @@ mod tests {
     fn test_string_dictionary_merge() {
         let mut builder = StringDictionaryBuilder::<Int32Type>::new();
         for i in 0..20 {
-            builder.append(&i.to_string()).unwrap();
+            builder.append(i.to_string()).unwrap();
         }
         let input_1 = builder.finish();
 
         let mut builder = StringDictionaryBuilder::<Int32Type>::new();
         for i in 0..30 {
-            builder.append(&i.to_string()).unwrap();
+            builder.append(i.to_string()).unwrap();
         }
         let input_2 = builder.finish();
 
diff --git a/arrow-string/src/substring.rs b/arrow-string/src/substring.rs
index fc2f6c8ad..bfdafb790 100644
--- a/arrow-string/src/substring.rs
+++ b/arrow-string/src/substring.rs
@@ -34,11 +34,11 @@ use std::sync::Arc;
 /// # Arguments
 ///
 /// * `start` - The start index of all substrings.
-/// If `start >= 0`, then count from the start of the string,
-/// otherwise count from the end of the string.
+///   If `start >= 0`, then count from the start of the string,
+///   otherwise count from the end of the string.
 ///
 /// * `length`(option) - The length of all substrings.
-/// If `length` is [None], then the substring is from `start` to the end of the string.
+///   If `length` is [None], then the substring is from `start` to the end of the string.
 ///
 /// Attention: Both `start` and `length` are counted by byte, not by char.
 ///
@@ -53,10 +53,13 @@ use std::sync::Arc;
 /// ```
 ///
 /// # Error
-/// - The function errors when the passed array is not a [`GenericStringArray`], [`GenericBinaryArray`], [`FixedSizeBinaryArray`]
-///   or [`DictionaryArray`] with supported array type as its value type.
-/// - The function errors if the offset of a substring in the input array is at invalid char boundary (only for \[Large\]String array).
-/// It is recommended to use [`substring_by_char`] if the input array may contain non-ASCII chars.
+/// - The function errors when the passed array is not a [`GenericStringArray`],
+///   [`GenericBinaryArray`], [`FixedSizeBinaryArray`] or [`DictionaryArray`]
+///   with supported array type as its value type.
+/// - The function errors if the offset of a substring in the input array is
+///   at invalid char boundary (only for \[Large\]String array).
+///   It is recommended to use [`substring_by_char`] if the input array may
+///   contain non-ASCII chars.
 ///
 /// ## Example of trying to get an invalid utf-8 format substring
 /// ```
@@ -155,22 +158,25 @@ pub fn substring(
     }
 }
 
+/// Substrings based on character index
+///
 /// # Arguments
 /// * `array` - The input string array
 ///
 /// * `start` - The start index of all substrings.
-/// If `start >= 0`, then count from the start of the string,
-/// otherwise count from the end of the string.
+///   If `start >= 0`, then count from the start of the string,
+///   otherwise count from the end of the string.
 ///
 /// * `length`(option) - The length of all substrings.
-/// If `length` is `None`, then the substring is from `start` to the end of the string.
+///   If `length` is `None`, then the substring is from `start` to the end of the string.
 ///
 /// Attention: Both `start` and `length` are counted by char.
 ///
 /// # Performance
-/// This function is slower than [substring].
-/// Theoretically, the time complexity is `O(n)` where `n` is the length of the value buffer.
-/// It is recommended to use [substring] if the input array only contains ASCII chars.
+///
+/// This function is slower than [substring]. Theoretically, the time complexity
+/// is `O(n)` where `n` is the length of the value buffer. It is recommended to
+/// use [substring] if the input array only contains ASCII chars.
 ///
 /// # Basic usage
 /// ```
@@ -396,7 +402,7 @@ mod tests {
     /// A helper macro to test the substring functions.
     /// # Arguments
     /// * `cases` - The test cases which is a vector of `(input, start, len, result)`.
-    /// Please look at [`gen_test_cases`] to find how to generate it.
+    ///   Please look at [`gen_test_cases`] to find how to generate it.
     /// * `array_ty` - The array type.
     /// * `substring_fn` - Either [`substring`] or [`substring_by_char`].
     macro_rules! do_test {
diff --git a/arrow/Cargo.toml b/arrow/Cargo.toml
index 9d3c431b3..745ca0321 100644
--- a/arrow/Cargo.toml
+++ b/arrow/Cargo.toml
@@ -75,7 +75,7 @@ pyarrow = ["pyo3", "ffi"]
 # force_validate runs full data validation for all arrays that are created
 # this is not enabled by default as it is too computationally expensive
 # but is run as part of our CI checks
-force_validate = ["arrow-data/force_validate"]
+force_validate = ["arrow-array/force_validate", "arrow-data/force_validate"]
 # Enable ffi support
 ffi = ["arrow-schema/ffi", "arrow-data/ffi", "arrow-array/ffi"]
 chrono-tz = ["arrow-array/chrono-tz"]
diff --git a/parquet/src/arrow/arrow_reader/mod.rs b/parquet/src/arrow/arrow_reader/mod.rs
index e9edf7cb7..15c1a880c 100644
--- a/parquet/src/arrow/arrow_reader/mod.rs
+++ b/parquet/src/arrow/arrow_reader/mod.rs
@@ -353,11 +353,11 @@ impl ArrowReaderOptions {
 /// This structure allows
 ///
 /// 1. Loading metadata for a file once and then using that same metadata to
-/// construct multiple separate readers, for example, to distribute readers
-/// across multiple threads
+///    construct multiple separate readers, for example, to distribute readers
+///    across multiple threads
 ///
 /// 2. Using a cached copy of the [`ParquetMetadata`] rather than reading it
-/// from the file each time a reader is constructed.
+///    from the file each time a reader is constructed.
 ///
 /// [`ParquetMetadata`]: crate::file::metadata::ParquetMetaData
 #[derive(Debug, Clone)]
@@ -553,10 +553,10 @@ impl<T: ChunkReader + 'static> ParquetRecordBatchReaderBuilder<T> {
     /// This interface allows:
     ///
     /// 1. Loading metadata once and using it to create multiple builders with
-    /// potentially different settings or run on different threads
+    ///    potentially different settings or run on different threads
     ///
     /// 2. Using a cached copy of the metadata rather than re-reading it from the
-    /// file each time a reader is constructed.
+    ///    file each time a reader is constructed.
     ///
     /// See the docs on [`ArrowReaderMetadata`] for more details
     ///
diff --git a/parquet/src/arrow/arrow_reader/statistics.rs b/parquet/src/arrow/arrow_reader/statistics.rs
index d536792b8..00a3ad90d 100644
--- a/parquet/src/arrow/arrow_reader/statistics.rs
+++ b/parquet/src/arrow/arrow_reader/statistics.rs
@@ -1297,14 +1297,14 @@ impl<'a> StatisticsConverter<'a> {
     /// # Parameters:
     ///
     /// * `column_page_index`: The parquet column page indices, read from
-    /// `ParquetMetaData` column_index
+    ///   `ParquetMetaData` column_index
     ///
     /// * `column_offset_index`: The parquet column offset indices, read from
-    /// `ParquetMetaData` offset_index
+    ///   `ParquetMetaData` offset_index
     ///
     /// * `row_group_indices`: The indices of the row groups, that are used to
-    /// extract the column page index and offset index on a per row group
-    /// per column basis.
+    ///   extract the column page index and offset index on a per row group
+    ///   per column basis.
     ///
     /// # Return Value
     ///
@@ -1423,13 +1423,13 @@ impl<'a> StatisticsConverter<'a> {
     /// # Parameters:
     ///
     /// * `column_offset_index`: The parquet column offset indices, read from
-    /// `ParquetMetaData` offset_index
+    ///   `ParquetMetaData` offset_index
     ///
     /// * `row_group_metadatas`: The metadata slice of the row groups, read
-    /// from `ParquetMetaData` row_groups
+    ///   from `ParquetMetaData` row_groups
     ///
     /// * `row_group_indices`: The indices of the row groups, that are used to
-    /// extract the column offset index on a per row group per column basis.
+    ///   extract the column offset index on a per row group per column basis.
     ///
     /// See docs on [`Self::data_page_mins`] for details.
     pub fn data_page_row_counts<I>(
diff --git a/parquet/src/file/metadata/mod.rs b/parquet/src/file/metadata/mod.rs
index 9f2084a35..16c51c811 100644
--- a/parquet/src/file/metadata/mod.rs
+++ b/parquet/src/file/metadata/mod.rs
@@ -202,11 +202,11 @@ impl ParquetMetaData {
     /// 1. Includes size of self
     ///
     /// 2. Includes heap memory for sub fields such as [`FileMetaData`] and
-    /// [`RowGroupMetaData`].
+    ///    [`RowGroupMetaData`].
     ///
     /// 3. Includes memory from shared pointers (e.g. [`SchemaDescPtr`]). This
-    /// means `memory_size` will over estimate the memory size if such pointers
-    /// are shared.
+    ///    means `memory_size` will over estimate the memory size if such pointers
+    ///    are shared.
     ///
     /// 4. Does not include any allocator overheads
     pub fn memory_size(&self) -> usize {
diff --git a/parquet/src/file/properties.rs b/parquet/src/file/properties.rs
index 654b5e23f..cd5969fda 100644
--- a/parquet/src/file/properties.rs
+++ b/parquet/src/file/properties.rs
@@ -566,8 +566,8 @@ impl WriterPropertiesBuilder {
     /// * If the bloom filter is enabled previously then it is a no-op.
     ///
     /// * If the bloom filter is not enabled, default values for ndv and fpp
-    /// value are used used. See [`set_bloom_filter_ndv`] and
-    /// [`set_bloom_filter_fpp`] to further adjust the ndv and fpp.
+    ///   value are used used. See [`set_bloom_filter_ndv`] and
+    ///   [`set_bloom_filter_fpp`] to further adjust the ndv and fpp.
     ///
     /// [`set_bloom_filter_ndv`]: Self::set_bloom_filter_ndv
     /// [`set_bloom_filter_fpp`]: Self::set_bloom_filter_fpp
diff --git a/parquet/src/file/writer.rs b/parquet/src/file/writer.rs
index 7806384cd..90e985a95 100644
--- a/parquet/src/file/writer.rs
+++ b/parquet/src/file/writer.rs
@@ -449,10 +449,11 @@ impl<W: Write + Send> SerializedFileWriter<W> {
 ///
 /// All columns should be written sequentially; the main workflow is:
 /// - Request the next column using `next_column` method - this will return `None` if no
-/// more columns are available to write.
+///   more columns are available to write.
 /// - Once done writing a column, close column writer with `close`
-/// - Once all columns have been written, close row group writer with `close` method -
-/// it will return row group metadata and is no-op on already closed row group.
+/// - Once all columns have been written, close row group writer with `close`
+///   method. THe close method will return row group metadata and is no-op
+///   on already closed row group.
 pub struct SerializedRowGroupWriter<'a, W: Write> {
     descr: SchemaDescPtr,
     props: WriterPropertiesPtr,
diff --git a/parquet/src/format.rs b/parquet/src/format.rs
index b210d6ec1..ae68865be 100644
--- a/parquet/src/format.rs
+++ b/parquet/src/format.rs
@@ -1941,9 +1941,13 @@ impl crate::thrift::TSerializable for LogicalType {
 //
 
 /// Represents a element inside a schema definition.
-///  - if it is a group (inner node) then type is undefined and num_children is defined
-///  - if it is a primitive type (leaf) then type is defined and num_children is undefined
-/// the nodes are listed in depth first traversal order.
+///
+///  - if it is a group (inner node) then type is undefined and num_children
+///    is defined
+///  - if it is a primitive type (leaf) then type is defined and
+///    num_children is undefined
+///
+/// Note the  nodes are listed in depth first traversal order.
 #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
 pub struct SchemaElement {
   /// Data type for this field. Not set if the current element is a non-leaf node


Test patch:
diff --git a/parquet/src/util/test_common/page_util.rs b/parquet/src/util/test_common/page_util.rs
index b4fed752f..858fd8c23 100644
--- a/parquet/src/util/test_common/page_util.rs
+++ b/parquet/src/util/test_common/page_util.rs
@@ -36,12 +36,13 @@ pub trait DataPageBuilder {
     fn consume(self) -> Page;
 }
 
-/// A utility struct for building data pages (v1 or v2). Callers must call:
-///   - add_rep_levels()
-///   - add_def_levels()
-///   - add_values() for normal data page / add_indices() for dictionary data page
-///   - consume()
-/// in order to populate and obtain a data page.
+/// A utility struct for building data pages (v1 or v2). Callers must call the
+/// following functions in order to populate and obtain a data page:
+///
+/// - add_rep_levels()
+/// - add_def_levels()
+/// - add_values() for normal data page / add_indices() for dictionary data page
+/// - consume()
 pub struct DataPageBuilderImpl {
     encoding: Option<Encoding>,
     num_values: u32,