Skip to content
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

Running clippy. #13

Merged
merged 1 commit into from
Sep 15, 2019
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
4 changes: 2 additions & 2 deletions dcmdump/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ fn main() -> DynResult<()> {
Err(ref e) if e.kind() == ErrorKind::BrokenPipe => {
Ok(()) // handle broken pipe separately with a no-op
}
Err(e) => Err(e)?, // raise other errors
_ => Ok(()), // all good
Err(e) => Err(e.into()), // raise other errors
_ => Ok(()), // all good
}
}

Expand Down
3 changes: 1 addition & 2 deletions object/src/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ where
}

impl FileMetaTable {
pub fn from_reader<R: Read>(file: R) -> Result<FileMetaTable> {
pub fn from_reader<R: Read>(file: R) -> Result<Self> {
FileMetaTable::read_from(file)
}

Expand Down Expand Up @@ -464,5 +464,4 @@ mod tests {
assert_eq!(table.private_information_creator_uid, None);
assert_eq!(table.private_information, None);
}

}
10 changes: 4 additions & 6 deletions parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ fn parse_time_impl(buf: &[u8], for_datetime: bool) -> Result<(NaiveTime, &[u8])>
let mut n = usize::min(6, buf.len());
if for_datetime {
// check for time zone suffix, restrict fraction size accordingly
if let Some(i) = buf.into_iter().position(|v| *v == b'+' || *v == b'-') {
if let Some(i) = buf.iter().position(|v| *v == b'+' || *v == b'-') {
n = i;
}
}
Expand Down Expand Up @@ -789,11 +789,9 @@ where
{
debug_assert!(!buf.is_empty());
debug_assert!(buf.len() < 10);
(&buf[1..])
.into_iter()
.fold((buf[0] - b'0').into(), |acc, v| {
acc * T::ten() + (*v - b'0').into()
})
(&buf[1..]).iter().fold((buf[0] - b'0').into(), |acc, v| {
acc * T::ten() + (*v - b'0').into()
})
}

fn parse_datetime(buf: &[u8], dt_utc_offset: FixedOffset) -> Result<DateTime<FixedOffset>> {
Expand Down
2 changes: 1 addition & 1 deletion transfer-syntax-registry/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! This crate contains the DICOM transfer syntax registry.
//! The transfer syntax registry maps a DICOM UID of a transfer syntax into the
//! respective transfer syntax specifier.
//!
//!
//! This registry should not have to be used directly, except when developing
//! higher level APIs, which should learn to negotiate and resolve the expected
//! transfer syntax automatically.
Expand Down