-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/577 complete onix 3 1 #664
base: develop
Are you sure you want to change the base?
Conversation
… inside ContentItem
…ibutions not fully working yet
Merge with develop
…ion for <PageRun> and <NumberOfPages> and move inside <TextItem> composite, break tests into smaller sections
for language in &chapter.languages { | ||
XmlElementBlock::<Onix312Thoth>::xml_element(language, w).ok(); | ||
} | ||
if chapter.short_abstract.is_some() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split these into individual ifs, removing the extra check inside the function (you're checking if either of these attributes is some, and then again in each function)
.map_err(|e| e.into()) | ||
})?; | ||
let identifiers: Vec<(&str, Option<&str>)> = vec![ | ||
("programname", self.program.as_deref().to_owned()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's no need to clone with to_owned
since Option<&str>
is just a reference
write_element_block("FundingIdentifier", w, |w| { | ||
// 01 Proprietary | ||
write_element_block("FundingIDType", w, |w| { | ||
w.write(XmlEvent::Characters("01")).map_err(|e| e.into()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All .map_err(|e| e.into())
can be turned into .map_err(Into::into)
#577