Skip to content

Bump MSRV to 1.81 #7336

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

Merged
merged 2 commits into from
Mar 27, 2025
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ include = [
"NOTICE.txt",
]
edition = "2021"
rust-version = "1.70"
rust-version = "1.81"

[workspace.dependencies]
arrow = { version = "54.3.0", path = "./arrow", default-features = false }
Expand Down
11 changes: 1 addition & 10 deletions arrow-cast/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,20 +463,11 @@ impl Parser for Float64Type {
}
}

/// This API is only stable since 1.70 so can't use it when current MSRV is lower
#[inline(always)]
fn is_some_and<T>(opt: Option<T>, f: impl FnOnce(T) -> bool) -> bool {
match opt {
None => false,
Some(x) => f(x),
}
}

macro_rules! parser_primitive {
($t:ty) => {
impl Parser for $t {
fn parse(string: &str) -> Option<Self::Native> {
if !is_some_and(string.as_bytes().last(), |x| x.is_ascii_digit()) {
if !string.as_bytes().last().is_some_and(|x| x.is_ascii_digit()) {
return None;
}
match atoi::FromRadix10SignedChecked::from_radix_10_signed_checked(
Expand Down
2 changes: 1 addition & 1 deletion arrow-flight/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ name = "arrow-flight"
description = "Apache Arrow Flight"
version = { workspace = true }
edition = { workspace = true }
rust-version = "1.71.1"
rust-version = { workspace = true }
authors = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion arrow-flight/gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ name = "gen"
description = "Code generation for arrow-flight"
version = "0.1.0"
edition = { workspace = true }
rust-version = "1.71.1"
rust-version = { workspace = true }
authors = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion arrow-integration-testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ authors = { workspace = true }
license = { workspace = true }
edition = { workspace = true }
publish = false
rust-version = "1.75.0"
rust-version = { workspace = true }

[lib]
crate-type = ["lib", "cdylib"]
Expand Down
11 changes: 1 addition & 10 deletions arrow-json/src/writer/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,15 +387,6 @@ struct StructArrayEncoder<'a> {
struct_mode: StructMode,
}

/// This API is only stable since 1.70 so can't use it when current MSRV is lower
#[inline(always)]
fn is_some_and<T>(opt: Option<T>, f: impl FnOnce(T) -> bool) -> bool {
match opt {
None => false,
Some(x) => f(x),
}
}

impl Encoder for StructArrayEncoder<'_> {
fn encode(&mut self, idx: usize, out: &mut Vec<u8>) {
match self.struct_mode {
Expand Down Expand Up @@ -740,7 +731,7 @@ impl<'a> MapEncoder<'a> {
));
}

if is_some_and(array.entries().nulls(), |x| x.null_count() != 0) {
if array.entries().nulls().is_some_and(|x| x.null_count() != 0) {
return Err(ArrowError::InvalidArgumentError(
"Encountered nulls in MapArray entries".to_string(),
));
Expand Down
2 changes: 1 addition & 1 deletion arrow-pyarrow-integration-testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ authors = ["Apache Arrow <[email protected]>"]
license = "Apache-2.0"
keywords = [ "arrow" ]
edition = "2021"
rust-version = "1.70"
rust-version = "1.81"
publish = false

[lib]
Expand Down
2 changes: 1 addition & 1 deletion arrow-schema/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ license = { workspace = true }
keywords = { workspace = true }
include = { workspace = true }
edition = { workspace = true }
rust-version = "1.64"
rust-version = { workspace = true }

[lib]
name = "arrow_schema"
Expand Down
2 changes: 1 addition & 1 deletion arrow-schema/src/extension/canonical/bool8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl ExtensionType for Bool8 {
}

fn deserialize_metadata(metadata: Option<&str>) -> Result<Self::Metadata, ArrowError> {
if metadata.map_or(false, str::is_empty) {
if metadata.is_some_and(str::is_empty) {
Ok("")
} else {
Err(ArrowError::InvalidArgumentError(
Expand Down
3 changes: 1 addition & 2 deletions parquet/src/arrow/async_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -837,9 +837,8 @@ where
self.batch_size,
)
.await
.map_err(|err| {
.inspect_err(|_| {
self.state = StreamState::Error;
err
})?;
self.reader_factory = Some(reader_factory);

Expand Down
Loading