diff --git a/Cargo.lock b/Cargo.lock index 1ddf0247..a2449f80 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -479,7 +479,6 @@ dependencies = [ "heck", "regex", "serde", - "serde_json", "sxd-document", "sxd-xpath", "ureq", @@ -607,7 +606,6 @@ dependencies = [ name = "dicom-parser" version = "0.8.0" dependencies = [ - "chrono", "dicom-core", "dicom-dictionary-std", "dicom-encoding", @@ -645,7 +643,6 @@ version = "0.8.0" dependencies = [ "bytes", "clap", - "dicom-dictionary-std", "dicom-ul", "snafu", "tracing", @@ -740,7 +737,6 @@ version = "0.8.0" dependencies = [ "byteordered", "bytes", - "dicom-core", "dicom-dictionary-std", "dicom-encoding", "dicom-transfer-syntax-registry", diff --git a/core/src/value/primitive.rs b/core/src/value/primitive.rs index 604d5b67..f3ddda64 100644 --- a/core/src/value/primitive.rs +++ b/core/src/value/primitive.rs @@ -464,8 +464,8 @@ impl PrimitiveValue { F32(c) => c.len() * 4, F64(c) => c.len() * 8, Tags(c) => c.len() * 4, - Str(s) => s.as_bytes().len(), - Strs(c) => c.iter().map(|s| s.as_bytes().len() + 1).sum::() & !1, + Str(s) => s.len(), + Strs(c) => c.iter().map(|s| s.len() + 1).sum::() & !1, Date(c) => { c.iter() .map(|d| PrimitiveValue::da_byte_len(d) + 1) diff --git a/devtools/dictionary-builder/Cargo.toml b/devtools/dictionary-builder/Cargo.toml index 1760a8cc..99ce0b6a 100644 --- a/devtools/dictionary-builder/Cargo.toml +++ b/devtools/dictionary-builder/Cargo.toml @@ -17,7 +17,6 @@ path = "src/main.rs" [dependencies] clap = { version = "4.0.18", features = ["cargo", "derive"] } serde = { version = "1.0.55", features = ["derive"] } -serde_json = "1.0.17" heck = "0.5.0" ureq = "2.4.0" sxd-document = "0.3.2" diff --git a/devtools/dictionary-builder/src/tags.rs b/devtools/dictionary-builder/src/tags.rs index 1743ee45..048f29af 100644 --- a/devtools/dictionary-builder/src/tags.rs +++ b/devtools/dictionary-builder/src/tags.rs @@ -84,6 +84,11 @@ pub fn run(args: DataElementApp) -> Result<()> { fn parse_entries(source: R) -> Result> { let mut result = vec![]; + let regex_tag = Regex::new(r"^\(([0-9A-F]{4}),([0-9A-F]{4})\)$")?; + let regex_tag_group100 = Regex::new(r"^\(([0-9A-F]{2})00-[0-9A-F]{2}FF,([0-9A-F]{4})\)$")?; + let regex_tag_element100 = + Regex::new(r"^\(([0-9A-F]{4}),([0-9A-F]{2})00-[0-9A-F]{2}FF\)$")?; + for line in source.lines() { let line = line?; if line.starts_with('#') { @@ -113,11 +118,6 @@ fn parse_entries(source: R) -> Result> { let tag = parts[0].to_string(); - let regex_tag = Regex::new(r"^\(([0-9A-F]{4}),([0-9A-F]{4})\)$")?; - let regex_tag_group100 = Regex::new(r"^\(([0-9A-F]{2})00-[0-9A-F]{2}FF,([0-9A-F]{4})\)$")?; - let regex_tag_element100 = - Regex::new(r"^\(([0-9A-F]{4}),([0-9A-F]{2})00-[0-9A-F]{2}FF\)$")?; - let cap = regex_tag.captures(tag.as_str()); let tag_type; let tag_declaration = if let Some(cap) = cap { diff --git a/parser/Cargo.toml b/parser/Cargo.toml index e3b437f3..3b9d9fc1 100644 --- a/parser/Cargo.toml +++ b/parser/Cargo.toml @@ -14,7 +14,6 @@ readme = "README.md" [dependencies] dicom-core = { path = "../core", version = "0.8.0" } dicom-encoding = { path = "../encoding", version = "0.8.0" } -chrono = { version = "0.4.22", default-features = false, features = ["std"] } dicom-dictionary-std = { path = "../dictionary-std/", version = "0.8.0" } smallvec = "1.6.1" snafu = "0.8" diff --git a/parser/src/dataset/read.rs b/parser/src/dataset/read.rs index 22b72b41..4404b2eb 100644 --- a/parser/src/dataset/read.rs +++ b/parser/src/dataset/read.rs @@ -378,7 +378,7 @@ where source: dicom_encoding::decode::Error::ReadItemHeader { source, .. }, .. }) if source.kind() == std::io::ErrorKind::UnexpectedEof - && self.seq_delimiters.pop().map_or(false, |t| t.pixel_data) + && self.seq_delimiters.pop().is_some_and(|t| t.pixel_data) => { // Note: if `UnexpectedEof` was reached while inside a // PixelData Sequence, then we assume that diff --git a/scpproxy/Cargo.toml b/scpproxy/Cargo.toml index 671791f1..1ced5af0 100644 --- a/scpproxy/Cargo.toml +++ b/scpproxy/Cargo.toml @@ -13,7 +13,6 @@ readme = "README.md" [dependencies] clap = { version = "4.0.18", features = ["cargo"] } dicom-ul = { path = "../ul/", version = "0.8.0" } -dicom-dictionary-std = { path = "../dictionary-std/", version = "0.8.0" } snafu = "0.8" tracing = "0.1.34" tracing-subscriber = "0.3.11" diff --git a/ul/Cargo.toml b/ul/Cargo.toml index 88fc1a81..9265cb37 100644 --- a/ul/Cargo.toml +++ b/ul/Cargo.toml @@ -31,7 +31,6 @@ features = [ ] [dev-dependencies] -dicom-core = { path = "../core" } dicom-dictionary-std = { path = "../dictionary-std" } matches = "0.1.8" rstest = "0.23.0" diff --git a/ul/src/association/client.rs b/ul/src/association/client.rs index 2afbb9c2..8b6c8e53 100644 --- a/ul/src/association/client.rs +++ b/ul/src/association/client.rs @@ -1170,7 +1170,7 @@ pub mod non_blocking { } } - impl<'a> ClientAssociationOptions<'a> { + impl ClientAssociationOptions<'_> { async fn establish_impl_async( self, ae_address: AeAddr, diff --git a/ul/src/association/pdata.rs b/ul/src/association/pdata.rs index 96bbb0c7..6028ae6e 100644 --- a/ul/src/association/pdata.rs +++ b/ul/src/association/pdata.rs @@ -267,7 +267,7 @@ impl<'a, R> PDataReader<'a, R> { } } -impl<'a, R> Read for PDataReader<'a, R> +impl Read for PDataReader<'_, R> where R: Read, { @@ -594,7 +594,7 @@ pub mod non_blocking { } } - impl<'a, R> AsyncRead for PDataReader<'a, R> + impl AsyncRead for PDataReader<'_, R> where R: AsyncRead + Unpin, { diff --git a/ul/src/association/server.rs b/ul/src/association/server.rs index 899cb496..14ba6aa9 100644 --- a/ul/src/association/server.rs +++ b/ul/src/association/server.rs @@ -906,7 +906,7 @@ pub mod non_blocking { read_pdu, write_pdu, Pdu, IMPLEMENTATION_CLASS_UID, IMPLEMENTATION_VERSION_NAME, }; - impl<'a, A> ServerAssociationOptions<'a, A> + impl ServerAssociationOptions<'_, A> where A: AccessControl, {