diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 715f148..5c328f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - rust: [stable, 1.84.0] + rust: [stable, 1.85.0] steps: - name: Install Rust uses: hecrj/setup-rust-action@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index d6c21ef..16f165d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ file is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Requires Rust 1.85 or newer. + ## [0.16.0] - 2025-10-06 ### Changed @@ -193,6 +199,7 @@ Versioning](https://semver.org/spec/v2.0.0.html). column-oriented form. - Interface to read CSV data into `Table`. +[Unreleased]: https://github.com/petabi/structured/compare/0.16.0...main [0.16.0]: https://github.com/petabi/structured/compare/0.15.0...0.16.0 [0.15.0]: https://github.com/petabi/structured/compare/0.14.1...0.15.0 [0.14.1]: https://github.com/petabi/structured/compare/0.14.0...0.14.1 diff --git a/Cargo.toml b/Cargo.toml index 9849a55..66f73e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,8 +6,8 @@ authors = [ "Min Shao ", "Sehkone Kim ", ] -edition = "2021" -rust-version = "1.84" +edition = "2024" +rust-version = "1.85" description = "Data structures to handle large, structured data." homepage = "https://github.com/petabi/structured" repository = "https://github.com/petabi/structured" diff --git a/src/csv.rs b/src/csv.rs index 196c3f0..056aefe 100644 --- a/src/csv.rs +++ b/src/csv.rs @@ -2,7 +2,7 @@ pub(crate) mod reader; -pub use reader::infer_schema; pub use reader::Config; pub use reader::FieldParser; +pub use reader::infer_schema; pub use reader::{Reader, Record}; diff --git a/src/csv/reader.rs b/src/csv/reader.rs index 1c0e225..efc455f 100644 --- a/src/csv/reader.rs +++ b/src/csv/reader.rs @@ -478,8 +478,8 @@ mod tests { use arrow::array::{Array, BinaryArray, StringArray}; use itertools::izip; - use jiff::civil::{date, DateTime}; - use serde_test::{assert_tokens, Token}; + use jiff::civil::{DateTime, date}; + use serde_test::{Token, assert_tokens}; use super::*; use crate::table::Column; @@ -602,11 +602,13 @@ mod tests { Field::new("", DataType::Utf8, false), ]; - assert!(schema - .fields() - .into_iter() - .zip(answers.into_iter()) - .all(|(a, b)| a.data_type() == b.data_type())); + assert!( + schema + .fields() + .into_iter() + .zip(answers.into_iter()) + .all(|(a, b)| a.data_type() == b.data_type()) + ); } #[test] diff --git a/src/stats.rs b/src/stats.rs index 01a4f6e..edf52e6 100644 --- a/src/stats.rs +++ b/src/stats.rs @@ -569,7 +569,7 @@ where for (k, v) in &count { top_n.push(((*k).clone(), *v)); } - top_n.sort_unstable_by(|a, b| b.1.cmp(&a.1)); + top_n.sort_unstable_by_key(|a| std::cmp::Reverse(a.1)); top_n } @@ -589,7 +589,7 @@ where .into_iter() .collect(); - freqs.sort_unstable_by(|a, b| b.1.cmp(&a.1)); + freqs.sort_unstable_by_key(|a| std::cmp::Reverse(a.1)); ( freqs.len(), diff --git a/src/table.rs b/src/table.rs index 9552b6e..78bc1f9 100644 --- a/src/table.rs +++ b/src/table.rs @@ -6,9 +6,9 @@ use std::sync::Arc; use std::vec; use arrow::array::{ - Array, BinaryArray, Float32Array, Float64Array, Int16Array, Int32Array, Int64Array, Int8Array, - PrimitiveArray, PrimitiveBuilder, StringArray, UInt16Array, UInt32Array, UInt64Array, - UInt8Array, + Array, BinaryArray, Float32Array, Float64Array, Int8Array, Int16Array, Int32Array, Int64Array, + PrimitiveArray, PrimitiveBuilder, StringArray, UInt8Array, UInt16Array, UInt32Array, + UInt64Array, }; use arrow::datatypes::{ArrowPrimitiveType, DataType, Int64Type, Schema, TimeUnit}; use num_traits::ToPrimitive; @@ -16,9 +16,9 @@ use serde::{Deserialize, Serialize}; use strum_macros::EnumString; use crate::stats::{ - convert_time_intervals, describe, n_largest_count, n_largest_count_datetime, - n_largest_count_enum, n_largest_count_float64, ColumnStatistics, GroupCount, GroupElement, - GroupElementCount, + ColumnStatistics, GroupCount, GroupElement, GroupElementCount, convert_time_intervals, + describe, n_largest_count, n_largest_count_datetime, n_largest_count_enum, + n_largest_count_float64, }; type ReverseEnumMaps = HashMap>>;