Skip to content

Commit 3a5537a

Browse files
authored
docs: fix broken links and add CI (#637)
1 parent 4d5b408 commit 3a5537a

File tree

10 files changed

+48
-17
lines changed

10 files changed

+48
-17
lines changed

.github/workflows/doc.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on:
2+
push:
3+
branches:
4+
- "master"
5+
pull_request:
6+
7+
name: "Build documentation"
8+
9+
jobs:
10+
build-doc:
11+
name: "Build documentation"
12+
runs-on: "ubuntu-latest"
13+
14+
steps:
15+
- name: "Checkout source code"
16+
uses: "actions/checkout@v3"
17+
18+
- name: "Setup stable toolchain"
19+
uses: "actions-rs/toolchain@v1"
20+
with:
21+
toolchain: "stable"
22+
profile: "minimal"
23+
override: true
24+
25+
- name: "Build docs"
26+
run: |
27+
RUSTDOCFLAGS="-D warnings -A rustdoc::missing-crate-level-docs" cargo doc --all

examples/starknet-cxx/starknet-cxx/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! This is a quick demo on exposing `starknet-crypto` to C++ with the cxx bridge:
2-
//! https://github.com/xJonathanLEI/starknet-rs/issues/325
2+
//! <https://github.com/xJonathanLEI/starknet-rs/issues/325>
33
//!
44
//! This wrapper crate expose functions that operate on strings, which is bad and probably hurts
55
//! performance. It's possible to make the C++ side create `Felt` instances and operate on

starknet-core/src/serde/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// Custom serialization/deserialization implementations for [`Vec<u8>`].
22
pub mod byte_array;
33

4-
/// Custom serialization/deserialization implementations for [`Felt`].
4+
/// Custom serialization/deserialization implementations for [`Felt`](crate::types::Felt).
55
pub mod unsigned_field_element;
66

77
pub(crate) mod num_hex;

starknet-core/src/types/eth_address.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct EthAddressVisitor;
2323
mod errors {
2424
use core::fmt::{Display, Formatter, Result};
2525

26-
/// Errors parsing [`EthAddress`] from a hex string.
26+
/// Errors parsing [`EthAddress`](super::EthAddress) from a hex string.
2727
#[derive(Debug)]
2828
pub enum FromHexError {
2929
/// The hex string is not 40 hexadecimal characters in length without the `0x` prefix.
@@ -32,11 +32,12 @@ mod errors {
3232
InvalidHexString,
3333
}
3434

35-
/// The [`Felt`] value is out of range for converting into [`EthAddress`].
35+
/// The [`Felt`](super::Felt) value is out of range for converting into
36+
/// [`EthAddress`](super::EthAddress).
3637
#[derive(Debug)]
3738
pub struct FromFieldElementError;
3839

39-
/// The byte slice is out of range for converting into [`EthAddress`].
40+
/// The byte slice is out of range for converting into [`EthAddress`](super::EthAddress).
4041
#[derive(Debug)]
4142
pub struct FromBytesSliceError;
4243

starknet-core/src/types/hash_256.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct Hash256Visitor;
2020
mod errors {
2121
use core::fmt::{Display, Formatter, Result};
2222

23-
/// Errors parsing [`Hash256`] from a hex string.
23+
/// Errors parsing [`Hash256`](super::Hash256) from a hex string.
2424
#[derive(Debug)]
2525
pub enum FromHexError {
2626
/// The hex string is not 64 hexadecimal characters in length without the `0x` prefix.
@@ -29,7 +29,7 @@ mod errors {
2929
InvalidHexString,
3030
}
3131

32-
/// The hash value is out of range for converting into [`Felt`].
32+
/// The hash value is out of range for converting into [`Felt`](super::Felt).
3333
#[derive(Debug)]
3434
pub struct ToFieldElementError;
3535

starknet-core/src/types/receipt_block.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use serde_with::serde_as;
44
use crate::serde::unsigned_field_element::UfeHex;
55
use starknet_types_core::felt::Felt;
66

7-
/// Block identifier used in [`TransactionReceiptWithBlockInfo`].
7+
/// Block identifier used in
8+
/// [`TransactionReceiptWithBlockInfo`](super::TransactionReceiptWithBlockInfo).
89
///
910
/// Instead of directly exposing the `block_hash` and `block_number` fields as [`Option<Felt>`],
1011
/// this struct captures the fact that these fields are always [`Some`](Option::Some) or

starknet-core/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ mod errors {
6666
/// Possible errors for decoding a Cairo short string.
6767
#[derive(Debug)]
6868
pub enum ParseCairoShortStringError {
69-
/// The encoded [`Felt`] value is out of range.
69+
/// The encoded [`Felt`](super::Felt) value is out of range.
7070
ValueOutOfRange,
7171
/// A null terminator (`0x00`) is encountered.
7272
UnexpectedNullTerminator,

starknet-providers/src/jsonrpc/transports/http.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl HttpTransport {
4141
}
4242

4343
/// Consumes the current [`HttpTransport`] instance and returns a new one with the header
44-
/// appended. Same as calling [`add_header`].
44+
/// appended. Same as calling [`add_header`](fn.add_header).
4545
pub fn with_header(self, name: String, value: String) -> Self {
4646
let mut headers = self.headers;
4747
headers.push((name, value));

starknet-providers/src/provider.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ pub trait Provider {
247247
where
248248
B: AsRef<BlockId> + Send + Sync;
249249

250-
/// Same as [estimate_fee], but only with one estimate.
250+
/// Same as [`estimate_fee`](fn.estimate_fee), but only with one estimate.
251251
async fn estimate_fee_single<R, S, B>(
252252
&self,
253253
request: R,
@@ -271,7 +271,7 @@ pub trait Provider {
271271
}
272272
}
273273

274-
/// Same as [simulate_transactions], but only with one simulation.
274+
/// Same as [`simulate_transactions`](fn.simulate_transactions), but only with one simulation.
275275
async fn simulate_transaction<B, T, S>(
276276
&self,
277277
block_id: B,

starknet-providers/src/sequencer/mod.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,18 @@ pub enum GatewayClientError {
4040
/// Sequencer error responses not parsable into [`StarknetError`]
4141
#[error(transparent)]
4242
SequencerError(SequencerError),
43-
/// Method is not supported (only when using as [Provider])
43+
/// Method is not supported (only when using as [`Provider`](crate::Provider))
4444
#[error("method not supported")]
4545
MethodNotSupported,
46-
/// Model conversion error (only when using as [Provider])
46+
/// Model conversion error (only when using as [`Provider`](crate::Provider))
4747
#[error("unable to convert gateway models to jsonrpc types")]
4848
ModelConversionError,
49-
/// Simulating multiple transactions is not supported (only when using as [Provider])
49+
/// Simulating multiple transactions is not supported (only when using as
50+
/// [`Provider`](crate::Provider))
5051
#[error("simulating multiple transactions not supported")]
5152
BulkSimulationNotSupported,
52-
/// At least one of the simulation flags is not supported (only when using as [Provider])
53+
/// At least one of the simulation flags is not supported (only when using as
54+
/// [`Provider`](crate::Provider))
5355
#[error("unsupported simulation flag")]
5456
UnsupportedSimulationFlag,
5557
}
@@ -140,7 +142,7 @@ impl SequencerGatewayProvider {
140142
}
141143

142144
/// Consumes the current [`SequencerGatewayProvider`] instance and returns a new one with the
143-
/// header appended. Same as calling [`add_header`].
145+
/// header appended. Same as calling [`add_header`](fn.add_header).
144146
pub fn with_header(self, name: String, value: String) -> Self {
145147
let mut headers = self.headers;
146148
headers.push((name, value));

0 commit comments

Comments
 (0)