Skip to content

Commit eab4b85

Browse files
committed
reduce the package size of uuid
1 parent 94ecea8 commit eab4b85

7 files changed

Lines changed: 46 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ jobs:
9090
- name: Version features
9191
run: cargo +1.60.0 build --manifest-path tests/smoke-test/Cargo.toml
9292

93+
examples:
94+
name: Tests / Stable
95+
runs-on: ubuntu-latest
96+
steps:
97+
- name: Checkout sources
98+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
99+
100+
- name: Examples
101+
run: cargo test --manifest-path examples/Cargo.toml
102+
93103
wasm_bindgen:
94104
name: Tests / WebAssembly (wasm-bindgen)
95105
runs-on: ubuntu-latest

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ categories = [
1414
description = "A library to generate and parse UUIDs."
1515
documentation = "https://docs.rs/uuid"
1616
edition = "2018"
17-
exclude = [
18-
".github/**"
17+
include = [
18+
"src",
19+
"README.md",
20+
"LICENSE-APACHE",
21+
"LICENSE-MIT",
1922
]
2023
keywords = [
2124
"guid",
@@ -190,12 +193,9 @@ version = "1.0.52"
190193
[dev-dependencies.rustversion]
191194
version = "1"
192195

193-
[target.'cfg(windows)'.dev-dependencies.windows-sys]
194-
version = "0.48.0"
195-
features = ["Win32_System_Com"]
196-
197196
[workspace]
198197
members = [
199198
"macros",
199+
"examples",
200200
"tests/smoke-test",
201201
]

examples/Cargo.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[package]
2+
name = "uuid-examples"
3+
version = "0.0.0"
4+
publish = false
5+
edition = "2018"
6+
7+
[[example]]
8+
name = "random_uuid"
9+
path = "src/random_uuid.rs"
10+
11+
[[example]]
12+
name = "sortable_uuid"
13+
path = "src/sortable_uuid.rs"
14+
15+
[[example]]
16+
name = "uuid_macro"
17+
path = "src/uuid_macro.rs"
18+
19+
[[example]]
20+
name = "windows_guid"
21+
path = "src/windows_guid.rs"
22+
23+
[dependencies.uuid]
24+
path = "../"
25+
features = ["v1", "v3", "v4", "v5", "v6", "v7", "v8"]
26+
27+
[target.'cfg(windows)'.dev-dependencies.windows-sys]
28+
version = "0.48.0"
29+
features = ["Win32_System_Com"]
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//!
33
//! If you enable the `v4` feature you can generate random UUIDs.
44
5-
#[cfg(feature = "v4")]
65
fn main() {
76
use uuid::Uuid;
87

@@ -12,6 +11,3 @@ fn main() {
1211

1312
println!("{}", uuid);
1413
}
15-
16-
#[cfg(not(feature = "v4"))]
17-
fn main() {}
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//!
33
//! If you enable the `v7` feature you can generate sortable UUIDs.
44
5-
#[cfg(feature = "v7")]
65
fn main() {
76
use uuid::Uuid;
87

@@ -12,6 +11,3 @@ fn main() {
1211

1312
println!("{}", uuid);
1413
}
15-
16-
#[cfg(not(feature = "v7"))]
17-
fn main() {}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77
//! If you enable the `macro-diagnostics` feature, you can see much better
88
//! error messages.
99
10-
#[test]
11-
fn parse_uuid_at_compile_time() {
10+
fn main() {
1211
use uuid::uuid;
1312

1413
let uuid = uuid!("67e55044-10b1-426f-9247-bb680e5fe0c8");
1514

1615
assert_eq!(Some(uuid::Version::Random), uuid.get_version());
1716
}
18-
19-
fn main() {}

0 commit comments

Comments
 (0)