Skip to content

Commit 84d65ef

Browse files
committed
fix rustdoc warnings, add to CI
1 parent 051467b commit 84d65ef

File tree

9 files changed

+32
-17
lines changed

9 files changed

+32
-17
lines changed

.evergreen/config.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ functions:
122122
${PREPARE_SHELL}
123123
.evergreen/check-clippy.sh
124124
125+
"check rustdoc":
126+
- command: shell.exec
127+
type: test
128+
params:
129+
shell: bash
130+
working_dir: "src"
131+
script: |
132+
${PREPARE_SHELL}
133+
.evergreen/check-rustdoc.sh
134+
125135
"init test-results":
126136
- command: shell.exec
127137
params:
@@ -162,6 +172,10 @@ tasks:
162172
commands:
163173
- func: "check clippy"
164174

175+
- name: "check-rustdoc"
176+
commands:
177+
- func: "check rustdoc"
178+
165179
axes:
166180
- id: "extra-rust-versions"
167181
values:
@@ -200,3 +214,4 @@ buildvariants:
200214
tasks:
201215
- name: "check-clippy"
202216
- name: "check-rustfmt"
217+
- name: "check-rustdoc"

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,12 @@ let query = doc! {
250250
The BSON format does not contain a dedicated UUID type, though it does have a "binary" type which
251251
has UUID subtypes. Accordingly, this crate provides a
252252
[`Binary`](https://docs.rs/bson/latest/bson/struct.Binary.html) struct which models this binary type
253-
and serializes to and deserializes from it. The popular [`uuid`](https://docs.rs/uuid) crate does provide a UUID type
254-
(`Uuid`), though its `Serialize` and `Deserialize` implementations operate on strings, so when using
255-
it with BSON, the BSON binary type will not be used. To facilitate the conversion between `Uuid`
256-
values and BSON binary values, the `uuid-0_8` feature flag can be enabled. This flag exposes a
257-
number of convenient conversions from `Uuid`, including the
258-
[`uuid_as_bson_binary`](https://docs.rs/bson/2.0.0-beta.3/bson/serde_helpers/uuid_as_binary/index.html)
253+
and serializes to and deserializes from it. The popular [`uuid`](https://docs.rs/uuid) crate does
254+
provide a UUID type (`Uuid`), though its `Serialize` and `Deserialize` implementations operate on
255+
strings, so when using it with BSON, the BSON binary type will not be used. To facilitate the
256+
conversion between `Uuid` values and BSON binary values, the `uuid-0_8` feature flag can be
257+
enabled. This flag exposes a number of convenient conversions from `Uuid`, including the
258+
[`uuid_as_binary`](https://docs.rs/bson/2.0.0-beta.3/bson/serde_helpers/uuid_as_binary/index.html)
259259
serde helper, which can be used to (de)serialize `Uuid`s to/from BSON binaries with the UUID
260260
subtype, and the `From<Uuid>` implementation for `Bson`, which allows `Uuid` values to be used in
261261
the `doc!` and `bson!` macros.

src/datetime.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use chrono::{LocalResult, TimeZone, Utc};
3030
/// will serialize to and deserialize from that format's equivalent of the
3131
/// [extended JSON representation](https://docs.mongodb.com/manual/reference/mongodb-extended-json/) of a datetime.
3232
/// To serialize a [`chrono::DateTime`] as a BSON datetime, you can use
33-
/// [`serde_helpers::chrono_datetime_as_bson_datetime`].
33+
/// [`crate::serde_helpers::chrono_datetime_as_bson_datetime`].
3434
///
3535
/// ```rust
3636
/// # #[cfg(feature = "chrono-0_4")]
@@ -125,7 +125,7 @@ impl crate::DateTime {
125125
self.to_chrono_private()
126126
}
127127

128-
/// Convert the given [`std::SystemTime`] to a [`DateTime`].
128+
/// Convert the given [`std::time::SystemTime`] to a [`DateTime`].
129129
///
130130
/// If the provided time is too far in the future or too far in the past to be represented
131131
/// by a BSON datetime, either [`DateTime::MAX`] or [`DateTime::MIN`] will be
@@ -151,7 +151,7 @@ impl crate::DateTime {
151151
}
152152
}
153153

154-
/// Convert this [`DateTime`] to a [`std::SystemTime`].
154+
/// Convert this [`DateTime`] to a [`std::time::SystemTime`].
155155
pub fn to_system_time(self) -> SystemTime {
156156
if self.0 >= 0 {
157157
SystemTime::UNIX_EPOCH + Duration::from_millis(self.0 as u64)

src/de/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub enum Error {
3030
EndOfStream,
3131

3232
/// A general error encountered during deserialization.
33-
/// See: https://docs.serde.rs/serde/de/trait.Error.html
33+
/// See: <https://docs.serde.rs/serde/de/trait.Error.html>
3434
#[non_exhaustive]
3535
DeserializationError {
3636
/// A message describing the error.

src/de/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ where
423423
/// sequences with the Unicode replacement character.
424424
///
425425
/// This is mainly useful when reading raw BSON returned from a MongoDB server, which
426-
/// in rare cases can contain invalidly truncated strings (https://jira.mongodb.org/browse/SERVER-24007).
426+
/// in rare cases can contain invalidly truncated strings (<https://jira.mongodb.org/browse/SERVER-24007>).
427427
/// For most use cases, [`crate::from_reader`] can be used instead.
428428
pub fn from_reader_utf8_lossy<R, T>(reader: R) -> Result<T>
429429
where
@@ -447,7 +447,7 @@ where
447447
/// sequences with the Unicode replacement character.
448448
///
449449
/// This is mainly useful when reading raw BSON returned from a MongoDB server, which
450-
/// in rare cases can contain invalidly truncated strings (https://jira.mongodb.org/browse/SERVER-24007).
450+
/// in rare cases can contain invalidly truncated strings (<https://jira.mongodb.org/browse/SERVER-24007>).
451451
/// For most use cases, [`crate::from_slice`] can be used instead.
452452
pub fn from_slice_utf8_lossy<'de, T>(bytes: &'de [u8]) -> Result<T>
453453
where

src/document.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ impl Document {
607607
/// stream.
608608
///
609609
/// This is mainly useful when reading raw BSON returned from a MongoDB server, which
610-
/// in rare cases can contain invalidly truncated strings (https://jira.mongodb.org/browse/SERVER-24007).
610+
/// in rare cases can contain invalidly truncated strings (<https://jira.mongodb.org/browse/SERVER-24007>).
611611
/// For most use cases, `Document::from_reader` can be used instead.
612612
pub fn from_reader_utf8_lossy<R: Read>(mut reader: R) -> crate::de::Result<Document> {
613613
Self::decode(&mut reader, true)

src/extjson/de.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub enum Error {
3535
InvalidObjectId(oid::Error),
3636

3737
/// A general error encountered during deserialization.
38-
/// See: https://docs.serde.rs/serde/de/trait.Error.html
38+
/// See: <https://docs.serde.rs/serde/de/trait.Error.html>
3939
DeserializationError { message: String },
4040
}
4141

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
//! ## Working with datetimes
214214
//!
215215
//! The BSON format includes a datetime type, which is modeled in this crate by the
216-
//! [`bson::DateTime`] struct, and the
216+
//! [`DateTime`] struct, and the
217217
//! `Serialize` and `Deserialize` implementations for this struct produce and parse BSON datetimes
218218
//! when serializing to or deserializing from BSON. The popular crate [`chrono`](docs.rs/chrono)
219219
//! also provides a `DateTime` type, but its `Serialize` and `Deserialize` implementations operate
@@ -262,7 +262,7 @@
262262
//! using it with BSON, the BSON binary type will not be used. To facilitate the conversion between
263263
//! `Uuid` values and BSON binary values, the `uuid-0_8` feature flag can be enabled. This flag
264264
//! exposes a number of convenient conversions from `Uuid`, including the
265-
//! [`serde_helpers::uuid_as_bson_binary`]
265+
//! [`serde_helpers::uuid_as_binary`]
266266
//! serde helper, which can be used to (de)serialize `Uuid`s to/from BSON binaries with the UUID
267267
//! subtype, and the `From<Uuid>` implementation for `Bson`, which allows `Uuid` values to be used
268268
//! in the `doc!` and `bson!` macros.

src/ser/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub enum Error {
1515
InvalidDocumentKey(Bson),
1616

1717
/// A general error that occurred during serialization.
18-
/// See: https://docs.rs/serde/1.0.110/serde/ser/trait.Error.html#tymethod.custom
18+
/// See: <https://docs.rs/serde/1.0.110/serde/ser/trait.Error.html#tymethod.custom>
1919
#[non_exhaustive]
2020
SerializationError {
2121
/// A message describing the error.

0 commit comments

Comments
 (0)