-
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
Better handling of missing DOIs when outputting Crossref metadata (#551, #565) #627
Conversation
@@ -79,14 +79,25 @@ impl XmlSpecification for DoiDepositCrossref { | |||
|
|||
impl XmlElementBlock<DoiDepositCrossref> for Work { | |||
fn xml_element<W: Write>(&self, w: &mut EventWriter<W>) -> ThothResult<()> { | |||
let work_type = match &self.work_type { | |||
let work = self; |
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.
I know this was introduced earlier, but I don't think it's necessary to declare this variable
"Missing chapter DOI".to_string(), | ||
)); | ||
// Caller should only pass in chapters which have DOIs | ||
unreachable!() |
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.
I guess we can now get rid off this condition and simply unwrap the DOI
let doi = chapter
.related_work
.doi
.as_ref()
.expect("Caller should only pass in chapters which have DOIs");
```
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.
Oh yes, nice :)
Fixes #551 and #565. Solution implemented for #551 was to exclude chapters without DOIs from existing Crossref output, rather than making a new output (as discussed in issue comments).