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

chore: Fix doc warning #1214

Merged
merged 2 commits into from
Jan 4, 2023
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 @@ -39,6 +39,26 @@ jobs:
- name: Check all targets
run: cargo check --all --all-targets --all-features

check-docs:
name: check docs
runs-on: ubuntu-latest

env:
RUSTFLAGS: "-D warnings"

steps:
- uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: hecrj/setup-rust-action@v1
with:
rust-version: "1.60"
- uses: Swatinem/rust-cache@v2
- name: cargo doc
run: cargo doc --workspace --no-deps --exclude examples

clippy:
name: cargo clippy
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions tonic-reflection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
pub mod proto {
#![allow(unreachable_pub)]
#![allow(missing_docs)]
#![allow(rustdoc::invalid_html_tags)]
include!("generated/grpc.reflection.v1alpha.rs");

pub const FILE_DESCRIPTOR_SET: &[u8] = include_bytes!("generated/reflection_v1alpha1.bin");
Expand Down
1 change: 1 addition & 0 deletions tonic-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

/// Useful protobuf types
pub mod pb {
#![allow(rustdoc::invalid_html_tags)]
include!("generated/google.rpc.rs");

/// Byte encoded FILE_DESCRIPTOR_SET.
Expand Down
8 changes: 4 additions & 4 deletions tonic/src/metadata/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ impl MetadataMap {
/// use `insert_bin`.
///
/// This method panics when the given key is a string and it cannot be
/// converted to a MetadataKey<Ascii>.
/// converted to a `MetadataKey<Ascii>`.
///
/// If the map did not previously have this key present, then `None` is
/// returned.
Expand Down Expand Up @@ -1008,7 +1008,7 @@ impl MetadataMap {
/// Like insert, but for Binary keys (for example "trace-proto-bin").
///
/// This method panics when the given key is a string and it cannot be
/// converted to a MetadataKey<Binary>.
/// converted to a `MetadataKey<Binary>`.
///
/// # Examples
///
Expand Down Expand Up @@ -1050,7 +1050,7 @@ impl MetadataMap {
/// use `append_bin`.
///
/// This method panics when the given key is a string and it cannot be
/// converted to a MetadataKey<Ascii>.
/// converted to a `MetadataKey<Ascii>`.
///
/// If the map did not previously have this key present, then `false` is
/// returned.
Expand Down Expand Up @@ -1099,7 +1099,7 @@ impl MetadataMap {
/// Like append, but for binary keys (for example "trace-proto-bin").
///
/// This method panics when the given key is a string and it cannot be
/// converted to a MetadataKey<Binary>.
/// converted to a `MetadataKey<Binary>`.
///
/// # Examples
///
Expand Down
8 changes: 4 additions & 4 deletions tonic/src/metadata/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl<VE: ValueEncoding> MetadataValue<VE> {
}

/// Convert a `Bytes` directly into a `MetadataValue` without validating.
/// For MetadataValue<Binary> the provided parameter must be base64
/// For `MetadataValue<Binary>` the provided parameter must be base64
/// encoded without padding bytes at the end.
///
/// # Safety
Expand Down Expand Up @@ -459,7 +459,7 @@ impl MetadataValue<Ascii> {
src.parse()
}

/// Converts a MetadataKey into a MetadataValue<Ascii>.
/// Converts a MetadataKey into a `MetadataValue<Ascii>`.
///
/// Since every valid MetadataKey is a valid MetadataValue this is done
/// infallibly.
Expand All @@ -478,9 +478,9 @@ impl MetadataValue<Ascii> {

/// Returns the length of `self`, in bytes.
///
/// This method is not available for MetadataValue<Binary> because that
/// This method is not available for `MetadataValue<Binary>` because that
/// cannot be implemented in constant time, which most people would probably
/// expect. To get the length of MetadataValue<Binary>, convert it to a
/// expect. To get the length of `MetadataValue<Binary>`, convert it to a
/// Bytes value and measure its length.
///
/// # Examples
Expand Down