Skip to content

RUST-736 Update documentation for 2.0 release #295

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

Merged
merged 5 commits into from
Aug 31, 2021

Conversation

patrickfreed
Copy link
Contributor

@patrickfreed patrickfreed commented Aug 26, 2021

RUST-736

This PR updates the documentation to account for the 2.0 API, namely the chrono and uuid changes. As part of that, it also completes RUST-997.

Some other housekeeping changes were made too:

  • the "re-exports" section was changed to look like the functions were defined at the top level via #[doc(inline)]
  • functionality that was gated behind feature flags are now documented
  • documentation linting was added to Evergreen

You can see all the new changes in action by running:

cargo +nightly rustdoc -p bson --all-features --open -- --cfg docsrs

and comparing it to our latest documentation on docs.rs.

[![crates.io](https://img.shields.io/crates/l/bson.svg)](https://crates.io/crates/bson)

Encoding and decoding support for BSON in Rust

## Index
- [Installation](#installation)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the structure was updated to match the driver's readme

impl<T: chrono::TimeZone> From<chrono::DateTime<T>> for Bson {
fn from(a: chrono::DateTime<T>) -> Bson {
Bson::DateTime(crate::DateTime::from(a))
}
}

#[cfg(feature = "uuid-0_8")]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed this wasn't here after I tried to ensure my documentation examples compiled. For completeness, I just went ahead and implemented it (RUST-997).


#![allow(clippy::cognitive_complexity)]
#![doc(html_root_url = "https://docs.rs/bson/2.0.0-beta.3")]
#![cfg_attr(docsrs, feature(doc_cfg))]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this allows us to display the little badges next to things that are behind feature flags

@@ -7,3 +7,4 @@ use_try_shorthand = true
wrap_comments = true
imports_layout = "HorizontalVertical"
imports_granularity = "Crate"
ignore = ["src/lib.rs"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rustfmt kept messing up the table that has the feature flags in it so I just had it skip lib.rs. Once rust-lang/rustfmt#4210 is released we should be able to remove this.

@patrickfreed patrickfreed marked this pull request as ready for review August 30, 2021 16:18
@patrickfreed patrickfreed force-pushed the RUST-736/document-for-2.0 branch from dbc930d to 6d621c0 Compare August 31, 2021 15:02
@patrickfreed patrickfreed merged commit 01fea3f into mongodb:master Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants