Fix root crate compilation dependencies to force sha1*
This commit is contained in:
parent
9eed5aeb07
commit
0214817122
7 changed files with 47 additions and 3 deletions
|
|
@ -9,3 +9,8 @@ pub mod speed_estimator;
|
|||
pub mod torrent_metainfo;
|
||||
|
||||
pub use hash_id::Id20;
|
||||
|
||||
assert_cfg::exactly_one! {
|
||||
feature = "sha1-crypto-hash",
|
||||
feature = "sha1-ring",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,11 @@ pub fn torrent_from_bytes_ext<'de, BufType: Deserialize<'de> + From<&'de [u8]>>(
|
|||
let mut t = TorrentMetaV1::deserialize(&mut de)?;
|
||||
let (digest, info_bytes) = match (de.torrent_info_digest, de.torrent_info_bytes) {
|
||||
(Some(digest), Some(info_bytes)) => (digest, info_bytes),
|
||||
_ => anyhow::bail!("programming error"),
|
||||
(o1, o2) => anyhow::bail!(
|
||||
"programming error: digest.is_some()={}, info_bytes.is_some()={}. Probably one of bencode/sha1* features isn't enabled.",
|
||||
o1.is_some(),
|
||||
o2.is_some()
|
||||
),
|
||||
};
|
||||
t.info_hash = Id20::new(digest);
|
||||
Ok(ParsedTorrent {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue