Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix broken link warnings #1056

Merged
merged 2 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -68,6 +69,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
Loading