Skip to content

Commit eafc891

Browse files
authored
Merge pull request #587 from qarmin/set_minimial_rust_version
Set minimal rust version to 1.72.0
2 parents f83125b + 12a03ae commit eafc891

File tree

19 files changed

+61
-15
lines changed

19 files changed

+61
-15
lines changed

.github/workflows/rust.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
rust:
17+
- 1.72.0
1718
- stable
1819
- beta
1920
steps:
@@ -24,16 +25,39 @@ jobs:
2425
components: clippy
2526
cache: true
2627
# test project with default + extra features
27-
- run: cargo test --features image,ndarray,sop-class,rle,cli,jpegxl
28+
- if: matrix.rust == 'stable' || matrix.rust == 'beta'
29+
run: cargo test --features image,ndarray,sop-class,rle,cli,jpegxl
2830
# test dicom-pixeldata with openjp2
29-
- run: cargo test -p dicom-pixeldata --features openjp2
31+
- if: matrix.rust == 'stable' || matrix.rust == 'beta'
32+
run: cargo test -p dicom-pixeldata --features openjp2
3033
# test dicom-pixeldata with openjpeg-sys and charls
31-
- run: cargo test -p dicom-pixeldata --features openjpeg-sys,charls
34+
- if: matrix.rust == 'stable' || matrix.rust == 'beta'
35+
run: cargo test -p dicom-pixeldata --features openjpeg-sys,charls
3236
# test dicom-pixeldata with gdcm-rs
33-
- run: cargo test -p dicom-pixeldata --features gdcm
37+
- if: matrix.rust == 'stable' || matrix.rust == 'beta'
38+
run: cargo test -p dicom-pixeldata --features gdcm
3439
# test dicom-pixeldata without default features
35-
- run: cargo test -p dicom-pixeldata --no-default-features
36-
- run: cargo test -p dicom-ul --features async
40+
- if: matrix.rust == 'stable' || matrix.rust == 'beta'
41+
run: cargo test -p dicom-pixeldata --no-default-features
42+
# test dicom-ul with async feature
43+
- if: matrix.rust == 'stable' || matrix.rust == 'beta'
44+
run: cargo test -p dicom-ul --features async
45+
# test library projects with minimum rust version
46+
- if: matrix.rust == '1.72.0'
47+
run: |
48+
cargo test -p dicom-core
49+
cargo test -p dicom-encoding
50+
cargo test -p dicom-dictionary-std
51+
cargo test -p dicom-parser
52+
cargo test -p dicom-transfer-syntax-registry
53+
cargo test -p dicom-object
54+
cargo test -p dicom-dump --no-default-features --features sop-class
55+
cargo test -p dicom-json
56+
cargo test -p dicom-ul
57+
cargo test -p dicom-pixeldata
58+
cargo check -p dicom
59+
env:
60+
RUSTFLAGS: -W warnings
3761
# run Clippy with stable toolchain
3862
- if: matrix.rust == 'stable'
3963
run: cargo clippy

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ no other development dependencies are necessary
101101
unless certain extensions are included via Cargo features.
102102
Consult each crate for guidelines on selecting features to suit your needs.
103103

104+
Minimum supported Rust version is 1.72.0 and only applies to the library crates with default features.
105+
Binary crates and extra features may require a newer version of Rust.
106+
104107
## Roadmap & Contributing
105108

106109
This project is under active development.

clippy.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
msrv="1.72.0"

core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.7.1"
44
authors = ["Eduardo Pinho <enet4mikeenet@gmail.com>"]
55
description = "Efficient and practical core library for DICOM compliant systems"
66
edition = "2018"
7+
rust-version = "1.72.0"
78
license = "MIT OR Apache-2.0"
89
repository = "https://github.com/Enet4/dicom-rs"
910
keywords = ["dicom"]

dictionary-std/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.7.0"
44
authors = ["Eduardo Pinho <enet4mikeenet@gmail.com>"]
55
description = "Standard DICOM attribute dictionary"
66
edition = "2018"
7+
rust-version = "1.72.0"
78
license = "MIT OR Apache-2.0"
89
repository = "https://github.com/Enet4/dicom-rs"
910
keywords = ["dicom", "dictionary"]

dump/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.7.1"
44
authors = ["Eduardo Pinho <enet4mikeenet@gmail.com>"]
55
description = "A CLI tool for inspecting DICOM files"
66
edition = "2018"
7+
rust-version = "1.72.0"
78
license = "MIT OR Apache-2.0"
89
repository = "https://github.com/Enet4/dicom-rs"
910
categories = ["command-line-utilities"]

encoding/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.7.1"
44
authors = ["Eduardo Pinho <enet4mikeenet@gmail.com>"]
55
description = "DICOM encoding and decoding primitives"
66
edition = "2018"
7+
rust-version = "1.72.0"
78
license = "MIT OR Apache-2.0"
89
repository = "https://github.com/Enet4/dicom-rs"
910
categories = ["encoding"]

fromimage/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "dicom-fromimage"
33
version = "0.7.0"
44
edition = "2018"
5+
rust-version = "1.72.0"
56
authors = ["Eduardo Pinho <enet4mikeenet@gmail.com>"]
67
description = "A CLI tool for replacing the image content from DICOM files"
78
license = "MIT OR Apache-2.0"

object/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "dicom-object"
33
version = "0.7.1"
44
authors = ["Eduardo Pinho <enet4mikeenet@gmail.com>"]
55
edition = "2018"
6+
rust-version = "1.72.0"
67
license = "MIT OR Apache-2.0"
78
repository = "https://github.com/Enet4/dicom-rs"
89
description = "A high-level API for reading and manipulating DICOM objects"

object/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ mod tests {
772772

773773
#[test]
774774
fn errors_not_too_large() {
775-
assert_type_not_too_large::<AccessError>(56);
775+
assert_type_not_too_large::<AccessError>(64);
776776
}
777777

778778
#[test]

object/src/mem.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -940,19 +940,21 @@ where
940940
/// reporting whether it was present.
941941
pub fn remove_element_by_name(&mut self, name: &str) -> Result<bool, AccessByNameError> {
942942
let tag = self.lookup_name(name)?;
943-
Ok(self.entries.remove(&tag).is_some()).inspect(|&removed| {
943+
Ok(self.entries.remove(&tag).is_some()).map(|removed| {
944944
if removed {
945945
self.len = Length::UNDEFINED;
946946
}
947+
removed
947948
})
948949
}
949950

950951
/// Remove and return a particular DICOM element by its tag.
951952
pub fn take_element(&mut self, tag: Tag) -> Result<InMemElement<D>> {
952953
self.entries
953954
.remove(&tag)
954-
.inspect(|_| {
955+
.map(|e| {
955956
self.len = Length::UNDEFINED;
957+
e
956958
})
957959
.context(NoSuchDataElementTagSnafu { tag })
958960
}
@@ -961,8 +963,9 @@ where
961963
/// if it is present,
962964
/// returns `None` otherwise.
963965
pub fn take(&mut self, tag: Tag) -> Option<InMemElement<D>> {
964-
self.entries.remove(&tag).inspect(|_| {
966+
self.entries.remove(&tag).map(|e| {
965967
self.len = Length::UNDEFINED;
968+
e
966969
})
967970
}
968971

@@ -974,8 +977,9 @@ where
974977
let tag = self.lookup_name(name)?;
975978
self.entries
976979
.remove(&tag)
977-
.inspect(|_| {
980+
.map(|e| {
978981
self.len = Length::UNDEFINED;
982+
e
979983
})
980984
.with_context(|| NoSuchDataElementAliasSnafu {
981985
tag,

parent/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.7.1"
44
authors = ["Eduardo Pinho <enet4mikeenet@gmail.com>"]
55
description = "A pure Rust implementation of the DICOM standard"
66
edition = "2018"
7+
rust-version = "1.72.0"
78
license = "MIT OR Apache-2.0"
89
repository = "https://github.com/Enet4/dicom-rs"
910
readme = "README.md"

parser/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.7.1"
44
authors = ["Eduardo Pinho <enet4mikeenet@gmail.com>"]
55
description = "A middle-level parser and printer of DICOM data sets"
66
edition = "2018"
7+
rust-version = "1.72.0"
78
license = "MIT OR Apache-2.0"
89
repository = "https://github.com/Enet4/dicom-rs"
910
categories = ["parser-implementations"]

parser/src/stateful/decode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,9 @@ where
913913
.context(DecodeItemHeaderSnafu {
914914
position: self.position,
915915
})
916-
.inspect(|_| {
916+
.map(|header| {
917917
self.position += 8;
918+
header
918919
})
919920
.map_err(From::from)
920921
}

pixeldata/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "dicom-pixeldata"
33
version = "0.7.1"
44
authors = ["Eduardo Pinho <enet4mikeenet@gmail.com>", "Peter Evers <pevers90@gmail.com>"]
55
edition = "2018"
6+
rust-version = "1.72.0"
67
license = "MIT OR Apache-2.0"
78
description = "A high-level API for decoding DICOM objects into images and ndarrays"
89
repository = "https://github.com/Enet4/dicom-rs"

pixeldata/src/attribute.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,11 +626,12 @@ mod tests {
626626

627627
#[test]
628628
fn errors_are_not_too_large() {
629+
let max_size = 88;
629630
let size = std::mem::size_of::<super::GetAttributeError>();
630631
assert!(
631-
size <= 80,
632-
"GetAttributeError size is too large ({} > 80)",
633-
size
632+
size <= max_size,
633+
"GetAttributeError size is too large ({} > {})",
634+
size, max_size
634635
);
635636
}
636637

toimage/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "dicom-toimage"
33
version = "0.7.1"
44
edition = "2018"
5+
rust-version = "1.72.0"
56
authors = ["Eduardo Pinho <enet4mikeenet@gmail.com>"]
67
description = "A CLI tool for converting DICOM files into general purpose image files"
78
license = "MIT OR Apache-2.0"

transfer-syntax-registry/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.7.1"
44
authors = ["Eduardo Pinho <enet4mikeenet@gmail.com>"]
55
description = "A registry of DICOM transfer syntaxes"
66
edition = "2018"
7+
rust-version = "1.72.0"
78
license = "MIT OR Apache-2.0"
89
repository = "https://github.com/Enet4/dicom-rs"
910
keywords = ["dicom"]

ul/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.7.1"
44
authors = ["Eduardo Pinho <enet4mikeenet@gmail.com>", "Paul Knopf <pauldotknopf@gmail.com>"]
55
description = "Types and methods for interacting with the DICOM Upper Layer Protocol"
66
edition = "2018"
7+
rust-version = "1.72.0"
78
license = "MIT OR Apache-2.0"
89
repository = "https://github.com/Enet4/dicom-rs"
910
categories = ["network-programming"]

0 commit comments

Comments
 (0)