Skip to content

Commit 129f21f

Browse files
mbrobbelwiedld
authored andcommitted
Bump MSRV to 1.81 (apache#7336)
* Bump MSRV to 1.81 * Fix clippy warnings
1 parent f510730 commit 129f21f

File tree

10 files changed

+10
-29
lines changed

10 files changed

+10
-29
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ include = [
7474
"NOTICE.txt",
7575
]
7676
edition = "2021"
77-
rust-version = "1.70"
77+
rust-version = "1.81"
7878

7979
[workspace.dependencies]
8080
arrow = { version = "54.3.1", path = "./arrow", default-features = false }

arrow-cast/src/parse.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -463,20 +463,11 @@ impl Parser for Float64Type {
463463
}
464464
}
465465

466-
/// This API is only stable since 1.70 so can't use it when current MSRV is lower
467-
#[inline(always)]
468-
fn is_some_and<T>(opt: Option<T>, f: impl FnOnce(T) -> bool) -> bool {
469-
match opt {
470-
None => false,
471-
Some(x) => f(x),
472-
}
473-
}
474-
475466
macro_rules! parser_primitive {
476467
($t:ty) => {
477468
impl Parser for $t {
478469
fn parse(string: &str) -> Option<Self::Native> {
479-
if !is_some_and(string.as_bytes().last(), |x| x.is_ascii_digit()) {
470+
if !string.as_bytes().last().is_some_and(|x| x.is_ascii_digit()) {
480471
return None;
481472
}
482473
match atoi::FromRadix10SignedChecked::from_radix_10_signed_checked(

arrow-flight/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ name = "arrow-flight"
2020
description = "Apache Arrow Flight"
2121
version = { workspace = true }
2222
edition = { workspace = true }
23-
rust-version = "1.71.1"
23+
rust-version = { workspace = true }
2424
authors = { workspace = true }
2525
homepage = { workspace = true }
2626
repository = { workspace = true }

arrow-flight/gen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ name = "gen"
2020
description = "Code generation for arrow-flight"
2121
version = "0.1.0"
2222
edition = { workspace = true }
23-
rust-version = "1.71.1"
23+
rust-version = { workspace = true }
2424
authors = { workspace = true }
2525
homepage = { workspace = true }
2626
repository = { workspace = true }

arrow-integration-testing/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ authors = { workspace = true }
2525
license = { workspace = true }
2626
edition = { workspace = true }
2727
publish = false
28-
rust-version = "1.75.0"
28+
rust-version = { workspace = true }
2929

3030
[lib]
3131
crate-type = ["lib", "cdylib"]

arrow-json/src/writer/encoder.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,6 @@ struct StructArrayEncoder<'a> {
387387
struct_mode: StructMode,
388388
}
389389

390-
/// This API is only stable since 1.70 so can't use it when current MSRV is lower
391-
#[inline(always)]
392-
fn is_some_and<T>(opt: Option<T>, f: impl FnOnce(T) -> bool) -> bool {
393-
match opt {
394-
None => false,
395-
Some(x) => f(x),
396-
}
397-
}
398-
399390
impl Encoder for StructArrayEncoder<'_> {
400391
fn encode(&mut self, idx: usize, out: &mut Vec<u8>) {
401392
match self.struct_mode {
@@ -740,7 +731,7 @@ impl<'a> MapEncoder<'a> {
740731
));
741732
}
742733

743-
if is_some_and(array.entries().nulls(), |x| x.null_count() != 0) {
734+
if array.entries().nulls().is_some_and(|x| x.null_count() != 0) {
744735
return Err(ArrowError::InvalidArgumentError(
745736
"Encountered nulls in MapArray entries".to_string(),
746737
));

arrow-pyarrow-integration-testing/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ authors = ["Apache Arrow <[email protected]>"]
2525
license = "Apache-2.0"
2626
keywords = [ "arrow" ]
2727
edition = "2021"
28-
rust-version = "1.70"
28+
rust-version = "1.81"
2929
publish = false
3030

3131
[lib]

arrow-schema/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ license = { workspace = true }
2626
keywords = { workspace = true }
2727
include = { workspace = true }
2828
edition = { workspace = true }
29-
rust-version = "1.64"
29+
rust-version = { workspace = true }
3030

3131
[lib]
3232
name = "arrow_schema"

arrow-schema/src/extension/canonical/bool8.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl ExtensionType for Bool8 {
4747
}
4848

4949
fn deserialize_metadata(metadata: Option<&str>) -> Result<Self::Metadata, ArrowError> {
50-
if metadata.map_or(false, str::is_empty) {
50+
if metadata.is_some_and(str::is_empty) {
5151
Ok("")
5252
} else {
5353
Err(ArrowError::InvalidArgumentError(

parquet/src/arrow/async_reader/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,9 +837,8 @@ where
837837
self.batch_size,
838838
)
839839
.await
840-
.map_err(|err| {
840+
.inspect_err(|_| {
841841
self.state = StreamState::Error;
842-
err
843842
})?;
844843
self.reader_factory = Some(reader_factory);
845844

0 commit comments

Comments
 (0)