Remove use of unreachable in favor of internal errors
type: reform pr: https://github.com/casey/intermodal/pull/351 fixes: - https://github.com/casey/intermodal/issues/188
This commit is contained in:
parent
52b78b90f6
commit
e54bdeb95d
|
@ -4,7 +4,8 @@ Changelog
|
|||
|
||||
UNRELEASED - 2020-04-10
|
||||
-----------------------
|
||||
- :books: [`xxxxxxxxxxxx`](https://github.com/casey/intermodal/commits/master) Improve badges - _Casey Rodarmor <casey@rodarmor.com>_
|
||||
- :art: [`xxxxxxxxxxxx`](https://github.com/casey/intermodal/commits/master) Remove use of unreachable in favor of internal errors ([#351](https://github.com/casey/intermodal/pull/351)) - Fixes [#188](https://github.com/casey/intermodal/issues/188) - _Casey Rodarmor <casey@rodarmor.com>_
|
||||
- :books: [`52b78b90f675`](https://github.com/casey/intermodal/commit/52b78b90f6751a72a64074619fbf19df2988ac14) Improve badges ([#350](https://github.com/casey/intermodal/pull/350)) - _Casey Rodarmor <casey@rodarmor.com>_
|
||||
|
||||
|
||||
[v0.1.3](https://github.com/casey/intermodal/releases/tag/v0.1.3) - 2020-04-10
|
||||
|
|
7
justfile
7
justfile
|
@ -19,7 +19,7 @@ stats PATH:
|
|||
cargo build --release
|
||||
time ./target/release/imdl --unstable torrent stats --input {{PATH}}
|
||||
|
||||
push: check
|
||||
push:
|
||||
! git branch | grep '* master'
|
||||
git push github
|
||||
|
||||
|
@ -36,7 +36,7 @@ test:
|
|||
cargo test --all
|
||||
|
||||
clippy:
|
||||
RUSTFLAGS="-D warnings" cargo clippy --all
|
||||
cargo clippy --all
|
||||
|
||||
fmt:
|
||||
cargo +nightly fmt --all
|
||||
|
@ -98,7 +98,7 @@ check: test clippy lint check-minimal-versions changelog-update
|
|||
draft: push
|
||||
hub pull-request -o --draft
|
||||
|
||||
pr: push
|
||||
pr: check push
|
||||
hub pull-request -o
|
||||
|
||||
merge:
|
||||
|
@ -110,7 +110,6 @@ merge:
|
|||
just done
|
||||
|
||||
update: man changelog-update update-toc
|
||||
cargo update
|
||||
|
||||
publish-check: check check-man
|
||||
cargo outdated --exit-code 1
|
||||
|
|
|
@ -176,7 +176,7 @@ impl From<walkdir::Error> for Error {
|
|||
if let Some(source) = walkdir_error.into_io_error() {
|
||||
Self::Filesystem { source, path }
|
||||
} else {
|
||||
unreachable!("Encountered unexpected walkdir error")
|
||||
Self::internal("Encountered walkdir error without source")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,7 +88,12 @@ impl Print for FileError {
|
|||
Self::Directory => write!(stream, "Expected file but found directory")?,
|
||||
Self::Surfeit(difference) => write!(stream, "{} too long", difference)?,
|
||||
Self::Dearth(difference) => write!(stream, "{} too short", difference)?,
|
||||
Self::Md5 { .. } => unreachable!(),
|
||||
Self::Md5 { .. } => {
|
||||
return Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
Error::internal("Reached unreachable branch").to_string(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
clippy::result_unwrap_used,
|
||||
clippy::shadow_reuse,
|
||||
clippy::too_many_lines,
|
||||
clippy::unreachable,
|
||||
clippy::unseparated_literal_suffix,
|
||||
clippy::wildcard_enum_match_arm
|
||||
)]
|
||||
|
|
|
@ -17,7 +17,7 @@ impl PieceLength {
|
|||
"Content".into(),
|
||||
"Piece Length".into(),
|
||||
"Count".into(),
|
||||
"Metainfo Size".into(),
|
||||
"Piece List Size".into(),
|
||||
));
|
||||
|
||||
for i in 14..51 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user