serialize everything
This commit is contained in:
parent
829cb64511
commit
a82579dfa5
1 changed files with 7 additions and 6 deletions
|
@ -46,13 +46,13 @@ impl<'de> Deserialize<'de> for Atoms {
|
|||
Sheet,
|
||||
}
|
||||
#[derive(Deserialize, new)]
|
||||
struct NotesSheet<'a> {
|
||||
notes: &'a str,
|
||||
sheet: &'a str,
|
||||
struct NotesSheet {
|
||||
notes: String,
|
||||
sheet: String,
|
||||
}
|
||||
struct NotesSheetVisitor;
|
||||
impl<'de> Visitor<'de> for NotesSheetVisitor {
|
||||
type Value = NotesSheet<'de>;
|
||||
type Value = NotesSheet;
|
||||
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
formatter.write_str("a \"notes\" field and a \"sheet\" field")
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ impl<'de> Deserialize<'de> for Atoms {
|
|||
const FIELDS: &[&str] = &["notes", "sheet"];
|
||||
let NotesSheet { notes, sheet } =
|
||||
deserializer.deserialize_struct("NotesSheet", FIELDS, NotesSheetVisitor)?;
|
||||
many0(flat_atom_parser(notes))(sheet)
|
||||
let x = many0(flat_atom_parser(¬es))(&sheet)
|
||||
.map_err(|e| e.to_string())
|
||||
.map_err(AtomsSerializeError::Parsing)
|
||||
.map_err(de::Error::custom)
|
||||
|
@ -107,7 +107,8 @@ impl<'de> Deserialize<'de> for Atoms {
|
|||
.map_err(AtomsSerializeError::from)
|
||||
.map_err(de::Error::custom)
|
||||
})
|
||||
.map(Atoms)
|
||||
.map(Atoms);
|
||||
x
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue