Skip to content

Commit 86abeaf

Browse files
committed
use newtype-uuid for the report UUID
1 parent 613556f commit 86abeaf

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## Unreleased
44

5+
## [0.4.0] - 2024-04-18
6+
7+
### Changed
8+
9+
- Use newtype-uuid for the report UUID.
10+
511
## [0.3.6] - 2024-04-08
612

713
- Updated repository to [https://github.com/nextest-rs/quick-junit](https://github.com/nextest-rs/quick-junit).
@@ -97,7 +103,8 @@
97103

98104
- Initial version.
99105

100-
[0.3.6-rc.1]: https://github.com/nextest-rs/quick-junit/releases/tag/quick-junit-0.3.6-rc.1
106+
[0.4.0]: https://github.com/nextest-rs/quick-junit/releases/tag/quick-junit-0.4.0
107+
[0.3.6]: https://github.com/nextest-rs/quick-junit/releases/tag/quick-junit-0.3.6
101108
[0.3.5]: https://github.com/nextest-rs/nextest/releases/tag/quick-junit-0.3.5
102109
[0.3.4]: https://github.com/nextest-rs/nextest/releases/tag/quick-junit-0.3.4
103110
[0.3.3]: https://github.com/nextest-rs/nextest/releases/tag/quick-junit-0.3.3

Cargo.lock

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ rust-version = "1.70"
1515
chrono = { version = "0.4.38", default-features = false, features = ["std"] }
1616
indexmap = "2.2.6"
1717
quick-xml = "0.31.0"
18+
newtype-uuid = "1.1.0"
1819
thiserror = "1.0.58"
19-
uuid = "1.8.0"
2020
strip-ansi-escapes = "0.2.0"
2121

2222
[dev-dependencies]

src/report.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,21 @@
44
use crate::{serialize::serialize_report, SerializeError};
55
use chrono::{DateTime, FixedOffset};
66
use indexmap::map::IndexMap;
7+
use newtype_uuid::{TypedUuid, TypedUuidKind, TypedUuidTag};
78
use std::{io, iter, time::Duration};
8-
use uuid::Uuid;
9+
10+
/// A tag indicating the kind of report.
11+
pub enum ReportKind {}
12+
13+
impl TypedUuidKind for ReportKind {
14+
fn tag() -> TypedUuidTag {
15+
const TAG: TypedUuidTag = TypedUuidTag::new("quick-junit-report");
16+
TAG
17+
}
18+
}
19+
20+
/// A unique identifier associated with a report.
21+
pub type ReportUuid = TypedUuid<ReportKind>;
922

1023
/// The root element of a JUnit report.
1124
#[derive(Clone, Debug)]
@@ -16,7 +29,7 @@ pub struct Report {
1629
/// A unique identifier associated with this report.
1730
///
1831
/// This is an extension to the spec that's used by nextest.
19-
pub uuid: Option<Uuid>,
32+
pub uuid: Option<ReportUuid>,
2033

2134
/// The time at which the first test in this report began execution.
2235
///
@@ -59,7 +72,7 @@ impl Report {
5972
/// Sets a unique ID for this `Report`.
6073
///
6174
/// This is an extension that's used by nextest.
62-
pub fn set_uuid(&mut self, uuid: Uuid) -> &mut Self {
75+
pub fn set_uuid(&mut self, uuid: ReportUuid) -> &mut Self {
6376
self.uuid = Some(uuid);
6477
self
6578
}

0 commit comments

Comments
 (0)