diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87c3ca0b..4fab5cf6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -159,3 +159,29 @@ jobs: with: directory: coverage #files: lcov.info + + doc: + name: Build-test documentation + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install rust toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rust-docs + + - uses: Swatinem/rust-cache@v1 + + - name: Run cargo doc + uses: actions-rs/cargo@v1 + env: + RUSTDOCFLAGS: -Dwarnings + with: + command: doc + args: --workspace --all-features --no-deps --document-private-items diff --git a/sentry-anyhow/src/lib.rs b/sentry-anyhow/src/lib.rs index c0a398b5..b3a68791 100644 --- a/sentry-anyhow/src/lib.rs +++ b/sentry-anyhow/src/lib.rs @@ -59,12 +59,8 @@ pub fn capture_anyhow(e: &anyhow::Error) -> Uuid { } /// Hub extension methods for working with [`anyhow`]. -/// -/// [`anyhow`]: https://docs.rs/anyhow pub trait AnyhowHubExt { /// Captures an [`anyhow::Error`] on a specific hub. - /// - /// [`anyhow::Error`]: https://docs.rs/anyhow/*/anyhow/struct.Error.html fn capture_anyhow(&self, e: &anyhow::Error) -> Uuid; } diff --git a/sentry-tower/src/lib.rs b/sentry-tower/src/lib.rs index 8800cc71..08ad4c01 100644 --- a/sentry-tower/src/lib.rs +++ b/sentry-tower/src/lib.rs @@ -127,6 +127,8 @@ //! .layer(sentry_tower::SentryHttpLayer::with_transaction()); //! # } //! ``` +//! +//! [`tower::ServiceBuilder`]: https://docs.rs/tower/latest/tower/struct.ServiceBuilder.html #![doc(html_favicon_url = "https://sentry-brand.storage.googleapis.com/favicon.ico")] #![doc(html_logo_url = "https://sentry-brand.storage.googleapis.com/sentry-glyph-black.png")] diff --git a/sentry-tracing/src/layer.rs b/sentry-tracing/src/layer.rs index bc9752a6..7cb1113c 100644 --- a/sentry-tracing/src/layer.rs +++ b/sentry-tracing/src/layer.rs @@ -94,6 +94,8 @@ impl SentryLayer { /// /// The filter classifies whether sentry should handle [`tracing::Span`]s based /// on their [`Metadata`]. + /// + /// [`tracing::Span`]: https://docs.rs/tracing/latest/tracing/struct.Span.html #[must_use] pub fn span_filter(mut self, filter: F) -> Self where diff --git a/sentry/src/transports/curl.rs b/sentry/src/transports/curl.rs index 296ae8f5..dda7244d 100644 --- a/sentry/src/transports/curl.rs +++ b/sentry/src/transports/curl.rs @@ -10,8 +10,6 @@ use crate::{sentry_debug, types::Scheme, ClientOptions, Envelope, Transport}; /// A [`Transport`] that sends events via the [`curl`] library. /// /// This is enabled by the `curl` feature flag. -/// -/// [`curl`]: https://crates.io/crates/curl #[cfg_attr(doc_cfg, doc(cfg(feature = "curl")))] pub struct CurlHttpTransport { thread: TransportThread, diff --git a/sentry/src/transports/reqwest.rs b/sentry/src/transports/reqwest.rs index 03e11438..aebb5024 100644 --- a/sentry/src/transports/reqwest.rs +++ b/sentry/src/transports/reqwest.rs @@ -12,7 +12,7 @@ use crate::{sentry_debug, ClientOptions, Envelope, Transport}; /// be the default transport. This is separately enabled by the /// `reqwest` feature flag. /// -/// [`reqwest`]: https://crates.io/crates/reqwest +/// [`reqwest`]: reqwest_ #[cfg_attr(doc_cfg, doc(cfg(feature = "reqwest")))] pub struct ReqwestHttpTransport { thread: TransportThread, diff --git a/sentry/src/transports/ureq.rs b/sentry/src/transports/ureq.rs index 0c3154b6..9d8124ca 100644 --- a/sentry/src/transports/ureq.rs +++ b/sentry/src/transports/ureq.rs @@ -1,6 +1,6 @@ use std::time::Duration; -#[cfg(fdoc)] +#[cfg(doc)] use ureq_ as ureq; use ureq_::{Agent, AgentBuilder, Proxy}; @@ -11,8 +11,6 @@ use crate::{sentry_debug, types::Scheme, ClientOptions, Envelope, Transport}; /// A [`Transport`] that sends events via the [`ureq`] library. /// /// This is enabled by the `ureq` feature flag. -/// -/// [`ureq`]: https://crates.io/crates/ureq #[cfg_attr(doc_cfg, doc(cfg(feature = "ureq")))] pub struct UreqHttpTransport { thread: TransportThread,