Skip to content

Commit 5d2203a

Browse files
committed
avoid module re-exports
Signed-off-by: Christian Poveda <[email protected]>
1 parent 945319b commit 5d2203a

File tree

18 files changed

+84
-74
lines changed

18 files changed

+84
-74
lines changed

cyclonedx-bom/src/specs/common/code.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ impl FromXml for Source {
872872
#[cfg(test)]
873873
pub(crate) mod test {
874874
use crate::{
875-
specs::v1_3::attached_text::test::{corresponding_attached_text, example_attached_text},
875+
specs::common::attached_text::test::{corresponding_attached_text, example_attached_text},
876876
xml::test::{read_element_from_string, write_element_to_string},
877877
};
878878

cyclonedx-bom/src/specs/common/tool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl FromXml for Tool {
220220
#[cfg(test)]
221221
pub(crate) mod test {
222222
use crate::{
223-
specs::v1_3::hash::test::{corresponding_hashes, example_hashes},
223+
specs::common::hash::test::{corresponding_hashes, example_hashes},
224224
xml::test::{read_element_from_string, write_element_to_string},
225225
};
226226

cyclonedx-bom/src/specs/v1_3/bom.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ use crate::{
2828
},
2929
};
3030
use crate::{
31+
specs::common::{dependency::Dependencies, property::Properties},
3132
specs::v1_3::{
32-
component::Components, composition::Compositions, dependency::Dependencies,
33-
external_reference::ExternalReferences, metadata::Metadata, property::Properties,
34-
service::Services,
33+
component::Components, composition::Compositions, external_reference::ExternalReferences,
34+
metadata::Metadata, service::Services,
3535
},
3636
xml::ToXml,
3737
};
@@ -337,15 +337,17 @@ impl From<UrnUuid> for models::bom::UrnUuid {
337337
#[cfg(test)]
338338
pub(crate) mod test {
339339
use crate::{
340+
specs::common::{
341+
dependency::test::{corresponding_dependencies, example_dependencies},
342+
property::test::{corresponding_properties, example_properties},
343+
},
340344
specs::v1_3::{
341345
component::test::{corresponding_components, example_components},
342346
composition::test::{corresponding_compositions, example_compositions},
343-
dependency::test::{corresponding_dependencies, example_dependencies},
344347
external_reference::test::{
345348
corresponding_external_references, example_external_references,
346349
},
347350
metadata::test::{corresponding_metadata, example_metadata},
348-
property::test::{corresponding_properties, example_properties},
349351
service::test::{corresponding_services, example_services},
350352
},
351353
xml::test::{read_document_from_string, write_element_to_string},

cyclonedx-bom/src/specs/v1_3/component.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ use crate::{
2727
normalized_string::NormalizedString,
2828
uri::{Purl, Uri},
2929
},
30-
specs::v1_3::{
31-
attached_text::AttachedText, code::Commits, code::Patches,
32-
external_reference::ExternalReferences, hash::Hashes, license::Licenses,
30+
specs::common::{
31+
attached_text::AttachedText, code::Commits, code::Patches, hash::Hashes,
3332
organization::OrganizationalEntity, property::Properties,
3433
},
34+
specs::v1_3::{external_reference::ExternalReferences, license::Licenses},
3535
xml::{
3636
attribute_or_error, optional_attribute, read_boolean_tag, read_lax_validation_list_tag,
3737
read_lax_validation_tag, read_list_tag, read_simple_tag, to_xml_read_error,
@@ -1176,18 +1176,20 @@ impl From<MimeType> for models::component::MimeType {
11761176
pub(crate) mod test {
11771177
use crate::{
11781178
models::bom::SpecVersion,
1179-
specs::v1_3::{
1179+
specs::common::{
11801180
attached_text::test::{corresponding_attached_text, example_attached_text},
11811181
code::test::{
11821182
corresponding_commits, corresponding_patches, example_commits, example_patches,
11831183
},
1184+
hash::test::{corresponding_hashes, example_hashes},
1185+
organization::test::{corresponding_entity, example_entity},
1186+
property::test::{corresponding_properties, example_properties},
1187+
},
1188+
specs::v1_3::{
11841189
external_reference::test::{
11851190
corresponding_external_references, example_external_references,
11861191
},
1187-
hash::test::{corresponding_hashes, example_hashes},
11881192
license::test::{corresponding_licenses, example_licenses},
1189-
organization::test::{corresponding_entity, example_entity},
1190-
property::test::{corresponding_properties, example_properties},
11911193
},
11921194
xml::test::{read_element_from_string, write_element_to_string},
11931195
};

cyclonedx-bom/src/specs/v1_3/external_reference.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use crate::{
2828
models,
2929
utilities::{convert_optional, convert_vec},
3030
};
31-
use crate::{specs::v1_3::hash::Hashes, xml::to_xml_write_error};
31+
use crate::{specs::common::hash::Hashes, xml::to_xml_write_error};
3232
use serde::{Deserialize, Serialize};
3333
use xml::{reader, writer::XmlEvent};
3434

@@ -213,7 +213,7 @@ impl FromXml for ExternalReference {
213213
pub(crate) mod test {
214214
use super::*;
215215
use crate::{
216-
specs::v1_3::hash::test::{corresponding_hashes, example_hashes},
216+
specs::common::hash::test::{corresponding_hashes, example_hashes},
217217
xml::test::{read_element_from_string, write_element_to_string},
218218
};
219219

cyclonedx-bom/src/specs/v1_3/license.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use crate::{
3232
ToXml,
3333
},
3434
};
35-
use crate::{specs::v1_3::attached_text::AttachedText, utilities::convert_optional};
35+
use crate::{specs::common::attached_text::AttachedText, utilities::convert_optional};
3636
use serde::{Deserialize, Serialize};
3737
use xml::{name::OwnedName, reader, writer};
3838

@@ -415,7 +415,7 @@ pub(crate) mod test {
415415
use super::*;
416416
use crate::{
417417
external_models::spdx::SpdxExpression,
418-
specs::v1_3::attached_text::test::{corresponding_attached_text, example_attached_text},
418+
specs::common::attached_text::test::{corresponding_attached_text, example_attached_text},
419419
xml::test::{read_element_from_string, write_element_to_string},
420420
};
421421

cyclonedx-bom/src/specs/v1_3/metadata.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ use crate::errors::BomError;
2020
use crate::{
2121
external_models::date_time::DateTime,
2222
models,
23-
specs::v1_3::{
24-
component::Component, license::Licenses, organization::OrganizationalContact,
25-
organization::OrganizationalEntity, property::Properties, tool::Tools,
23+
specs::common::{
24+
organization::OrganizationalContact, organization::OrganizationalEntity,
25+
property::Properties, tool::Tools,
2626
},
27+
specs::v1_3::{component::Component, license::Licenses},
2728
utilities::{convert_optional, convert_optional_vec, try_convert_optional},
2829
xml::{
2930
read_lax_validation_tag, read_list_tag, read_simple_tag, to_xml_read_error,
@@ -295,15 +296,17 @@ impl FromXml for Metadata {
295296
#[cfg(test)]
296297
pub(crate) mod test {
297298
use crate::{
298-
specs::v1_3::{
299-
component::test::{corresponding_component, example_component},
300-
license::test::{corresponding_licenses, example_licenses},
299+
specs::common::{
301300
organization::test::{
302301
corresponding_contact, corresponding_entity, example_contact, example_entity,
303302
},
304303
property::test::{corresponding_properties, example_properties},
305304
tool::test::{corresponding_tools, example_tools},
306305
},
306+
specs::v1_3::{
307+
component::test::{corresponding_component, example_component},
308+
license::test::{corresponding_licenses, example_licenses},
309+
},
307310
xml::test::{read_element_from_string, write_element_to_string},
308311
};
309312

cyclonedx-bom/src/specs/v1_3/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,3 @@ pub(crate) mod external_reference;
2323
pub(crate) mod license;
2424
pub(crate) mod metadata;
2525
pub(crate) mod service;
26-
27-
pub(crate) use super::common::{
28-
attached_text, code, dependency, hash, organization, property, tool,
29-
};

cyclonedx-bom/src/specs/v1_3/service.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ use crate::{
3030
use serde::{Deserialize, Serialize};
3131
use xml::{reader, writer::XmlEvent};
3232

33-
use crate::specs::v1_3::{
34-
external_reference::ExternalReferences, license::Licenses, organization::OrganizationalEntity,
35-
property::Properties,
36-
};
33+
use crate::specs::common::{organization::OrganizationalEntity, property::Properties};
34+
use crate::specs::v1_3::{external_reference::ExternalReferences, license::Licenses};
3735

3836
#[derive(Debug, Deserialize, Serialize, PartialEq)]
3937
#[serde(transparent)]
@@ -487,13 +485,15 @@ impl FromXml for DataClassification {
487485
pub(crate) mod test {
488486
use super::*;
489487
use crate::{
488+
specs::common::{
489+
organization::test::{corresponding_entity, example_entity},
490+
property::test::{corresponding_properties, example_properties},
491+
},
490492
specs::v1_3::{
491493
external_reference::test::{
492494
corresponding_external_references, example_external_references,
493495
},
494496
license::test::{corresponding_licenses, example_licenses},
495-
organization::test::{corresponding_entity, example_entity},
496-
property::test::{corresponding_properties, example_properties},
497497
},
498498
xml::test::{read_element_from_string, write_element_to_string},
499499
};

cyclonedx-bom/src/specs/v1_4/bom.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ use crate::{
2626
},
2727
};
2828
use crate::{
29+
specs::common::{dependency::Dependencies, property::Properties},
2930
specs::v1_4::{
30-
component::Components, composition::Compositions, dependency::Dependencies,
31-
external_reference::ExternalReferences, metadata::Metadata, property::Properties,
32-
service::Services, signature::Signature, vulnerability::Vulnerabilities,
31+
component::Components, composition::Compositions, external_reference::ExternalReferences,
32+
metadata::Metadata, service::Services, signature::Signature,
33+
vulnerability::Vulnerabilities,
3334
},
3435
xml::ToXml,
3536
};
@@ -370,15 +371,17 @@ pub(crate) mod test {
370371
corresponding_vulnerabilities, example_vulnerabilities,
371372
};
372373
use crate::{
374+
specs::common::{
375+
dependency::test::{corresponding_dependencies, example_dependencies},
376+
property::test::{corresponding_properties, example_properties},
377+
},
373378
specs::v1_4::{
374379
component::test::{corresponding_components, example_components},
375380
composition::test::{corresponding_compositions, example_compositions},
376-
dependency::test::{corresponding_dependencies, example_dependencies},
377381
external_reference::test::{
378382
corresponding_external_references, example_external_references,
379383
},
380384
metadata::test::{corresponding_metadata, example_metadata},
381-
property::test::{corresponding_properties, example_properties},
382385
service::test::{corresponding_services, example_services},
383386
signature::test::{corresponding_signature, example_signature},
384387
},

0 commit comments

Comments
 (0)