There was an error while loading. Please reload this page.
2 parents 959e73d + 74533bf commit b73936eCopy full SHA for b73936e
1 file changed
src/lib.rs
@@ -11,6 +11,7 @@ use derivative::Derivative;
11
use semver::Version;
12
use std::borrow::Borrow;
13
use std::collections::{BTreeMap, BTreeSet, HashMap};
14
+#[cfg(feature = "borsh")]
15
use std::io::{Read, Write};
16
17
/// A map that stores values indexed by semantic versions with support for alternate lookups.
@@ -59,10 +60,11 @@ impl<T> VersionMap<T> {
59
60
}
61
62
63
+ #[cfg(any(feature = "borsh", feature = "serde"))]
64
fn from_versions(versions: BTreeMap<WrappedVersion, T>) -> Self {
65
let mut alternates: HashMap<Version, BTreeSet<WrappedVersion>> = HashMap::new();
66
- for (version, _) in &versions {
67
+ for version in versions.keys() {
68
if let Some(alternate) = version_alternate(&version.inner) {
69
alternates
70
.entry(alternate)
0 commit comments