mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-07 20:50:03 +00:00
Use Vec
for field MetaData::other
by using `tuple_vec_map` to make the `Vec<(CompactString, serde_json::Value)>` appears as a map. This is OK because we don't access that part anyway and only add such field to avoid losing any information when deserialize, modify it and serialize it again to overwrite existing metafile. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
4ad8e4f46e
commit
c5db0fefb5
1 changed files with 3 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
use std::{
|
||||
borrow, cmp,
|
||||
collections::{btree_set, BTreeMap, BTreeSet},
|
||||
collections::{btree_set, BTreeSet},
|
||||
hash,
|
||||
io::{self, Seek, Write},
|
||||
iter::{IntoIterator, Iterator},
|
||||
|
@ -27,8 +27,8 @@ pub struct MetaData {
|
|||
|
||||
/// Forwards compatibility. Unknown keys from future versions of Cargo
|
||||
/// will be stored here and retained when the file is saved.
|
||||
#[serde(flatten)]
|
||||
pub other: BTreeMap<CompactString, serde_json::Value>,
|
||||
#[serde(flatten, with = "tuple_vec_map")]
|
||||
pub other: Vec<(CompactString, serde_json::Value)>,
|
||||
}
|
||||
|
||||
impl borrow::Borrow<str> for MetaData {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue