Skip to content

Commit a594ea7

Browse files
authored
document types that require features (#1291)
1 parent 96d3233 commit a594ea7

2 files changed

Lines changed: 26 additions & 4 deletions

File tree

crates/cxx-qt-lib/Cargo.toml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
[package]
77
name = "cxx-qt-lib"
88
version.workspace = true
9-
authors = ["Andrew Hayzen <andrew.hayzen@kdab.com>", "Gerhard de Clercq <gerhard.declercq@kdab.com>", "Leon Matthes <leon.matthes@kdab.com>"]
9+
authors = [
10+
"Andrew Hayzen <andrew.hayzen@kdab.com>",
11+
"Gerhard de Clercq <gerhard.declercq@kdab.com>",
12+
"Leon Matthes <leon.matthes@kdab.com>",
13+
]
1014
edition.workspace = true
1115
license.workspace = true
1216
description = "Qt types for integrating `cxx-qt` crate with `cxx`"
1317
repository.workspace = true
14-
exclude = [ "**/generate.sh" ]
18+
exclude = ["**/generate.sh"]
1519

1620
# When creating a library with cxx-qt-build, we need to set a fake "links" key
1721
# to make sure the build scripts are run in the correct order and the build scripts
@@ -20,6 +24,10 @@ exclude = [ "**/generate.sh" ]
2024
links = "cxx-qt-lib"
2125
rust-version.workspace = true
2226

27+
[package.metadata.docs.rs]
28+
all-features = true
29+
rustdoc-args = ["--cfg", "docsrs"]
30+
2331
[dependencies]
2432
cxx.workspace = true
2533
cxx-qt.workspace = true
@@ -30,7 +38,7 @@ rgb = { version = "0.8", optional = true }
3038
time = { version = "0.3.20", optional = true }
3139
url = { version = "2.3", optional = true }
3240
uuid = { version = "1.1.0", optional = true }
33-
serde = { version = "1", features=["derive"], optional = true }
41+
serde = { version = "1", features = ["derive"], optional = true }
3442
# Note: The image crate is not yet at 1.0 and a new version is released regularly.
3543
# To avoid a breaking change at each update, we don't specify a default version, and make the versions explicit.
3644
# Once 1.0 is released, we can add a dependency on `image`, which would then be `image = "1"`
@@ -46,7 +54,19 @@ qt-build-utils.workspace = true
4654
serde_json = "1.0.135"
4755

4856
[features]
49-
full = ["qt_full", "serde", "url", "uuid", "time", "rgb", "http", "chrono", "bytes", "image-v0-24", "image-v0-25"]
57+
full = [
58+
"qt_full",
59+
"serde",
60+
"url",
61+
"uuid",
62+
"time",
63+
"rgb",
64+
"http",
65+
"chrono",
66+
"bytes",
67+
"image-v0-24",
68+
"image-v0-25",
69+
]
5070
default = []
5171

5272
qt_full = ["qt_gui", "qt_qml", "qt_quickcontrols"]

crates/cxx-qt-lib/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
//
55
// SPDX-License-Identifier: MIT OR Apache-2.0
66

7+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
8+
79
#[cfg(not(any(cxxqt_qt_version_major = "5", cxxqt_qt_version_major = "6")))]
810
compile_error!("cxxqt_qt_version_major must be either \"5\" or \"6\"");
911

0 commit comments

Comments
 (0)