Skip to content

Commit 9e4be95

Browse files
committed
rustdoc: enforce rustdocs to build without warnings in ci
1 parent a9a930d commit 9e4be95

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ wasm: ## Build WASM modules
3838

3939
.PHONY: doc
4040
doc: ## Generate documentation
41-
RUSTDOCFLAGS="--cfg=doc_cfg -Zunstable-options --generate-link-to-definition" RUSTC_BOOTSTRAP=1 cargo doc --all-features --no-deps
41+
RUSTDOCFLAGS="-Dwarnings --cfg=doc_cfg -Zunstable-options --generate-link-to-definition" RUSTC_BOOTSTRAP=1 cargo doc --all-features --no-deps
4242

4343
.PHONY: doc-open
4444
doc-open: ## Generate and open documentation

crates/sui-graphql-client-build/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ sui-graphql-client-build = { git = "https://github.com/mystenlabs/sui-rust-sdk",
3131
```
3232

3333
4. If using `cynic`, use the cynic generator to generate the Rust types from the GraphQL schema. \
34-
Go to https://generator.cynic-rs.dev/ and paste the URL to the GraphQL service or manually copy paste the schema. \
34+
Go to <https://generator.cynic-rs.dev/> and paste the URL to the GraphQL service or manually copy paste the schema. \
3535
Then you can select the fields in the query you want to have, and the generator will generate the Rust types for you.
3636

3737
5. In your Rust code, you can now use the custom query types generated by `cynic`.
@@ -57,6 +57,6 @@ async fn main() {
5757
}
5858
```
5959

60-
6. For `UInt53`, you can use `u64` type directly as the `sui-graphql-client`'s schema implements the `impl_scalar`. Similarly for other types (Base64, DateTime). See more available types here: https://github.com/MystenLabs/sui-rust-sdk/blob/02639f6b09375fe03fa2243868be17bec1dfa33c/crates/sui-graphql-client/src/query_types/mod.rs?plain=1#L124-L126
60+
6. For `UInt53`, you can use `u64` type directly as the `sui-graphql-client`'s schema implements the `impl_scalar`. Similarly for other types (Base64, DateTime). See more available types here: <https://github.com/MystenLabs/sui-rust-sdk/blob/02639f6b09375fe03fa2243868be17bec1dfa33c/crates/sui-graphql-client/src/query_types/mod.rs?plain=1#L124-L126>
6161

6262
7. Read the `cynic` [documentation](https://cynic-rs.dev/) to learn how to work with it, particularly when it comes to passing arguments to the query.

crates/sui-graphql-client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async fn main() -> Result<()> {
6767
```
6868

6969
### Example for custom faucet service.
70-
Note that this [`FaucetClient`] is explicitly designed to work with two endpoints: `v1/gas`, and `v1/status`. When passing in the custom faucet URL, skip the final endpoint and only pass in the top-level url (e.g., `https://faucet.devnet.sui.io`).
70+
Note that this `FaucetClient` is explicitly designed to work with two endpoints: `v1/gas`, and `v1/status`. When passing in the custom faucet URL, skip the final endpoint and only pass in the top-level url (e.g., `https://faucet.devnet.sui.io`).
7171
```rust, no_run
7272
use sui_graphql_client::faucet::FaucetClient;
7373
use sui_types::Address;

crates/sui-graphql-client/src/streams.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ where
151151
/// Creates a new `PageStream` for a paginated query.
152152
///
153153
/// Examples
154+
///
154155
/// ```rust,ignore
155156
/// use futures::StreamExt;
156157
/// use sui_graphql_client::streams::stream_paginated_query;
@@ -160,8 +161,9 @@ where
160161
///
161162
/// let client = Client::new_testnet();
162163
/// let stream = stream_paginated_query(|pagination_filter, Direction::Forward| {
163-
/// client.coins(owner, coin_type, pagination_filter })
164+
/// client.coins(owner, coin_type, pagination_filter)
164165
/// });
166+
///
165167
/// while let Some(result) = stream.next().await {
166168
/// match result {
167169
/// Ok(coin) => println!("Got coin: {:?}", coin),

crates/sui-transaction-builder/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use sui_types::Upgrade;
2727
use base64ct::Encoding;
2828
use serde::Serialize;
2929

30-
/// A builder for creating transactions. Use [`resolve`] to finalize the transaction data.
30+
/// A builder for creating transactions. Use `resolve` to finalize the transaction data.
3131
#[derive(Clone, Default, Debug)]
3232
pub struct TransactionBuilder {
3333
/// The inputs to the transaction.
@@ -95,7 +95,7 @@ impl TransactionBuilder {
9595

9696
/// Add one or more gas objects to use to pay for the transaction.
9797
///
98-
/// Most commonly the gas can be passed as a reference to an owned/immutable [`Object`],
98+
/// Most commonly the gas can be passed as a reference to an owned/immutable `Object`,
9999
/// or can created using one of the of the constructors of the [`unresolved::Input`] enum,
100100
/// e.g., [`unresolved::Input::owned`].
101101
pub fn add_gas_objects<O, I>(&mut self, gas: I)
@@ -227,7 +227,7 @@ impl TransactionBuilder {
227227
///
228228
/// let mut tx = TransactionBuilder::new();
229229
/// let package_id = "0x...".parse().unwrap();
230-
/// let upgrade_cap = tx.input(unresolved::Input::by_id("0x...".parse().unwrap());
230+
/// let upgrade_cap = tx.input(unresolved::Input::by_id("0x...".parse().unwrap()));
231231
/// let upgrade_policy = tx.input(Serialized(&0u8));
232232
/// // the digest of the new package that was compiled
233233
/// let package_digest: &[u8] = &[
@@ -286,7 +286,7 @@ impl TransactionBuilder {
286286
}
287287

288288
/// Assuming everything is resolved, convert this transaction into the
289-
/// resolved form. Returns a [`Transaction`] if successful, or an [`Error`] if not.
289+
/// resolved form. Returns a [`Transaction`] if successful, or an `Error` if not.
290290
pub fn finish(self) -> Result<Transaction, Error> {
291291
let Some(sender) = self.sender else {
292292
return Err(Error::MissingSender);

0 commit comments

Comments
 (0)