Skip to content

Commit

Permalink
docs: Fix broken link warnings (#1056)
Browse files Browse the repository at this point in the history
* docs: Fix broken link warnings

* ci: Check for documentation warnings
  • Loading branch information
caspermeijn authored May 31, 2024
1 parent 52ff081 commit ef4930c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 6 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- rustfmt
- toml_validation
- clippy
- docs
- machete
- unused_dependencies
- test
Expand Down Expand Up @@ -69,6 +70,25 @@ jobs:
components: clippy
- run: cargo clippy --workspace --exclude protobuf --all-features --tests -- -D warnings

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: install protoc
uses: taiki-e/install-action@v2
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- name: install ninja
uses: ./.github/actions/setup-ninja
- uses: dtolnay/rust-toolchain@stable
- name: "doc --lib --all-features"
run: |
cargo doc --lib --no-deps --all-features --document-private-items
env:
RUSTDOCFLAGS: -Dwarnings

machete:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions prost-build/src/code_generator/c_escaping.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use log::debug;

/// Based on [`google::protobuf::UnescapeCEscapeString`][1]
///
/// [1]: https://github.com/google/protobuf/blob/3.3.x/src/google/protobuf/stubs/strutil.cc#L312-L322
pub(super) fn unescape_c_escape_string(s: &str) -> Vec<u8> {
let src = s.as_bytes();
Expand Down
2 changes: 1 addition & 1 deletion prost-build/src/collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub(crate) enum MapType {
#[non_exhaustive]
#[derive(Default, Clone, Copy, Debug, PartialEq)]
pub(crate) enum BytesType {
/// The [`alloc::collections::Vec::<u8>`] type.
/// The [`prost::alloc::vec::Vec<u8>`] type.
#[default]
Vec,
/// The [`bytes::Bytes`] type.
Expand Down
2 changes: 1 addition & 1 deletion prost-build/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ impl Config {
///
/// This is generally used when control over the output should not be managed by Prost,
/// such as in a flow for a `protoc` code generating plugin. When compiling as part of a
/// `build.rs` file, instead use [`compile_protos()`].
/// `build.rs` file, instead use [`Self::compile_protos()`].
pub fn generate(
&mut self,
requests: Vec<(Module, FileDescriptorProto)>,
Expand Down
6 changes: 4 additions & 2 deletions prost-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,6 @@ pub fn compile_protos(protos: &[impl AsRef<Path>], includes: &[impl AsRef<Path>]
/// This function can be combined with a crate like [`protox`] which outputs a
/// [`FileDescriptorSet`] and is a pure Rust implementation of `protoc`.
///
/// [`protox`]: https://github.com/andrewhickman/protox
///
/// # Example
/// ```rust,no_run
/// # use prost_types::FileDescriptorSet;
Expand All @@ -269,6 +267,10 @@ pub fn compile_protos(protos: &[impl AsRef<Path>], includes: &[impl AsRef<Path>]
/// prost_build::compile_fds(file_descriptor_set)
/// }
/// ```
///
/// [`protox`]: https://github.com/andrewhickman/protox
/// [1]: https://doc.rust-lang.org/std/macro.include.html
/// [2]: http://doc.crates.io/build-script.html#case-study-code-generation
pub fn compile_fds(fds: FileDescriptorSet) -> Result<()> {
Config::new().compile_fds(fds)
}
Expand Down
2 changes: 1 addition & 1 deletion prost/src/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub trait Name: Message {
/// Type URL for this [`Message`], which by default is the full name with a
/// leading slash, but may also include a leading domain name, e.g.
/// `type.googleapis.com/google.profile.Person`.
/// This can be used when serializing with the [`Any`] type.
/// This can be used when serializing into the `google.protobuf.Any` type.
fn type_url() -> String {
format!("/{}", Self::full_name())
}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pub mod oneof_attributes {
include!(concat!(env!("OUT_DIR"), "/foo.custom.one_of_attrs.rs"));
}

/// Issue https://github.com/tokio-rs/prost/issues/118
/// Issue <https://github.com/tokio-rs/prost/issues/118>
///
/// When a message contains an enum field with a default value, we
/// must ensure that the appropriate name conventions are used.
Expand Down

0 comments on commit ef4930c

Please sign in to comment.