Skip to content

Commit

Permalink
Merge branch 'chore/clippy-lint' into chore/cargo-update-2024-12
Browse files Browse the repository at this point in the history
  • Loading branch information
Enet4 committed Dec 7, 2024
2 parents 6de1bc7 + 16ee87d commit de6d27f
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 20 deletions.
4 changes: 0 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions core/src/value/primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<usize>() & !1,
Str(s) => s.len(),
Strs(c) => c.iter().map(|s| s.len() + 1).sum::<usize>() & !1,
Date(c) => {
c.iter()
.map(|d| PrimitiveValue::da_byte_len(d) + 1)
Expand Down
1 change: 0 additions & 1 deletion devtools/dictionary-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions devtools/dictionary-builder/src/tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ pub fn run(args: DataElementApp) -> Result<()> {
fn parse_entries<R: BufRead>(source: R) -> Result<Vec<Entry>> {
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('#') {
Expand Down Expand Up @@ -113,11 +118,6 @@ fn parse_entries<R: BufRead>(source: R) -> Result<Vec<Entry>> {

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 {
Expand Down
1 change: 0 additions & 1 deletion parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion parser/src/dataset/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion scpproxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion ul/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ul/src/association/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ pub mod non_blocking {
}
}

impl<'a> ClientAssociationOptions<'a> {
impl ClientAssociationOptions<'_> {
async fn establish_impl_async<T>(
self,
ae_address: AeAddr<T>,
Expand Down
4 changes: 2 additions & 2 deletions ul/src/association/pdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ impl<'a, R> PDataReader<'a, R> {
}
}

impl<'a, R> Read for PDataReader<'a, R>
impl<R> Read for PDataReader<'_, R>
where
R: Read,
{
Expand Down Expand Up @@ -594,7 +594,7 @@ pub mod non_blocking {
}
}

impl<'a, R> AsyncRead for PDataReader<'a, R>
impl<R> AsyncRead for PDataReader<'_, R>
where
R: AsyncRead + Unpin,
{
Expand Down
2 changes: 1 addition & 1 deletion ul/src/association/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<A> ServerAssociationOptions<'_, A>
where
A: AccessControl,
{
Expand Down

0 comments on commit de6d27f

Please sign in to comment.