Skip to content

Commit

Permalink
Remove function alias.
Browse files Browse the repository at this point in the history
  • Loading branch information
KmolYuan committed Aug 31, 2022
1 parent 87cc4ad commit 902a986
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ pub(crate) fn load(doc: &str, mount: &str, auto_reload: bool) -> Result<String,
eprintln!("{}\n{}", msg, indicated_msg(doc.as_bytes(), pos));
IoError::new(ErrorKind::InvalidData, msg)
};
let metadata = Metadata::deserialize;
let to_slides = Vec::deserialize;
let to_slides_flatten = |ns: &[NodeRc]| {
ns.iter()
.filter(|n| !n.is_null())
Expand All @@ -173,11 +171,11 @@ pub(crate) fn load(doc: &str, mount: &str, auto_reload: bool) -> Result<String,
let (metadata, slides) = match yaml.as_slice() {
[] => (Metadata::default(), Slides::single("Hello", "World!")),
[n1] => {
let slides = to_slides(n1.clone()).map_err(disp)?;
let slides = Vec::deserialize(n1.clone()).map_err(disp)?;
(Metadata::default(), Slides { slides })
}
ns @ [n1, ns_sub @ ..] => {
if let Ok(metadata) = metadata(n1.clone()) {
if let Ok(metadata) = Metadata::deserialize(n1.clone()) {
let slides = to_slides_flatten(ns_sub).map_err(disp)?;
(metadata, Slides { slides })
} else {
Expand Down

0 comments on commit 902a986

Please sign in to comment.