Skip to content

Commit

Permalink
fix: resolve clippy lints blocking merge
Browse files Browse the repository at this point in the history
  • Loading branch information
rpavlik committed May 20, 2024
1 parent 0c2e56a commit 6491039
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/models/spdx_document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub struct SPDX {
#[serde(default)]
pub annotations: Vec<Annotation>,

/// Counter for creating SPDXRefs. Is not part of the spec, so don't serialize.
/// Counter for creating `SPDXRefs`. Is not part of the spec, so don't serialize.
#[serde(skip)]
pub spdx_ref_counter: i32,
}
Expand Down
40 changes: 20 additions & 20 deletions src/parsers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,11 +614,11 @@ fn process_atom_for_relationships(

#[derive(Debug, Default)]
struct AnnotationInProgress {
annotator_in_progress: Option<String>,
date_in_progress: Option<DateTime<Utc>>,
comment_in_progress: Option<String>,
type_in_progress: Option<AnnotationType>,
spdxref_in_progress: Option<String>,
annotator: Option<String>,
date: Option<DateTime<Utc>>,
comment: Option<String>,
annotation_type: Option<AnnotationType>,
spdxref: Option<String>,
}

fn process_annotation(
Expand All @@ -627,11 +627,11 @@ fn process_annotation(
annotations: &mut Vec<Annotation>,
) {
if let AnnotationInProgress {
annotator_in_progress: Some(annotator),
date_in_progress: Some(date),
comment_in_progress: Some(comment),
type_in_progress: Some(annotation_type),
spdxref_in_progress: Some(spdxref),
annotator: Some(annotator),
date: Some(date),
comment: Some(comment),
annotation_type: Some(annotation_type),
spdxref: Some(spdxref),
} = &mut annotation_in_progress
{
let annotation = Annotation::new(
Expand All @@ -642,11 +642,11 @@ fn process_annotation(
comment.clone(),
);
*annotation_in_progress = AnnotationInProgress {
annotator_in_progress: None,
comment_in_progress: None,
date_in_progress: None,
spdxref_in_progress: None,
type_in_progress: None,
annotator: None,
comment: None,
date: None,
spdxref: None,
annotation_type: None,
};
annotations.push(annotation);
}
Expand All @@ -661,19 +661,19 @@ fn process_atom_for_annotations(

match atom {
Atom::Annotator(value) => {
annotation_in_progress.annotator_in_progress = Some(value.clone());
annotation_in_progress.annotator = Some(value.clone());
}
Atom::AnnotationDate(value) => {
annotation_in_progress.date_in_progress = Some(parse_date_time(value)?);
annotation_in_progress.date = Some(parse_date_time(value)?);
}
Atom::AnnotationComment(value) => {
annotation_in_progress.comment_in_progress = Some(value.clone());
annotation_in_progress.comment = Some(value.clone());
}
Atom::AnnotationType(value) => {
annotation_in_progress.type_in_progress = Some(*value);
annotation_in_progress.annotation_type = Some(*value);
}
Atom::SPDXREF(value) => {
annotation_in_progress.spdxref_in_progress = Some(value.clone());
annotation_in_progress.spdxref = Some(value.clone());
}
_ => {}
}
Expand Down

0 comments on commit 6491039

Please sign in to comment.