Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/models/checksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use serde::{Deserialize, Serialize};

/// Representation of SPDX's
///
/// [Package Checksum](https://spdx.github.io/spdx-spec/3-package-information/#310-package-checksum)
/// and
/// [File Checksum](https://spdx.github.io/spdx-spec/4-file-information/#44-file-checksum).
Expand All @@ -30,6 +31,7 @@ impl Checksum {
}

/// Possible algorithms to be used for SPDX's
///
/// [package checksum](https://spdx.github.io/spdx-spec/3-package-information/#310-package-checksum)
/// and [file checksum](https://spdx.github.io/spdx-spec/4-file-information/#44-file-checksum).
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Clone, Copy)]
Expand Down
4 changes: 1 addition & 3 deletions src/models/file_information.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ impl FileInformation {
.iter()
.find(|&checksum| checksum.algorithm == algorithm);

checksum.map_or(false, |checksum| {
checksum.value.to_ascii_lowercase() == value.to_ascii_lowercase()
})
checksum.is_some_and(|checksum| checksum.value.eq_ignore_ascii_case(value))
}

/// Get checksum
Expand Down
3 changes: 2 additions & 1 deletion src/models/package_information.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,13 @@ pub enum ExternalPackageReferenceCategory {
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Copy)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[serde(rename_all = "SCREAMING-KEBAB-CASE")]
pub enum PrimaryPackagePurpose {
Application,
Framework,
Library,
Container,
#[serde(alias = "OPERATING_SYSTEM")]
OperatingSystem,
Device,
Firmware,
Expand Down
1 change: 1 addition & 0 deletions src/models/spdx_document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ pub struct SPDX {

/// Counter for creating SPDXRefs. Is not part of the spec, so don't serialize.
#[serde(skip)]
#[allow(clippy::doc_markdown)]
pub spdx_ref_counter: i32,
}

Expand Down
5 changes: 3 additions & 2 deletions src/parsers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fn spdx_from_atoms(atoms: &[Atom]) -> Result<SPDX, SpdxError> {
atom,
&mut file_in_progress,
&mut file_information,
&package_in_progress,
package_in_progress.as_ref(),
&mut relationships,
);
process_atom_for_snippets(atom, &mut snippet_information, &mut snippet_in_progress);
Expand Down Expand Up @@ -411,7 +411,7 @@ fn process_atom_for_files(
atom: &Atom,
mut file_in_progress: &mut Option<FileInformation>,
files: &mut Vec<FileInformation>,
package_in_progress: &Option<PackageInformation>,
package_in_progress: Option<&PackageInformation>,
relationships: &mut HashSet<Relationship>,
) {
match atom {
Expand Down Expand Up @@ -595,6 +595,7 @@ fn process_atom_for_relationships(
}

#[derive(Debug, Default)]
#[allow(clippy::struct_field_names)]
struct AnnotationInProgress {
annotator_in_progress: Option<String>,
date_in_progress: Option<DateTime<Utc>>,
Expand Down
Loading