Skip to content

Commit e7b3d9f

Browse files
committed
A couple of simplications
1 parent 9ce669e commit e7b3d9f

File tree

2 files changed

+2
-7
lines changed
  • modules

2 files changed

+2
-7
lines changed

modules/fundamental/src/sbom/service/sbom.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,7 @@ impl SbomService {
139139
.alias("sbom_node", "r0")
140140
.translator(|f, op, v| match f.split_once(':') {
141141
Some(("label", key)) => Some(format!("labels:{key}{op}{v}")),
142-
None => match f {
143-
"version" => Some(format!("versions{op}{v}")),
144-
_ => None,
145-
},
142+
Some(("version", _key)) => Some(format!("versions{op}{v}")),
146143
_ => None,
147144
}),
148145
)?

modules/ingestor/src/graph/sbom/spdx.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ fn versions(sbom: &SPDX) -> Vec<String> {
8383
if !describing.contains(p.package_spdx_identifier.as_str()) {
8484
continue;
8585
}
86-
if let Some(version) = &p.package_version {
87-
result.insert(version.clone());
88-
}
86+
result.extend(p.package_version.clone());
8987
}
9088

9189
Vec::from_iter(result)

0 commit comments

Comments
 (0)