From d7a65982d595c847adabf8d3d0e7f8e2ee703a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Sun, 17 Jan 2021 15:07:35 +0100 Subject: [PATCH] Fix some doc issues --- heed-types/src/integer.rs | 6 +++--- heed-types/src/lib.rs | 2 +- heed-types/src/str.rs | 2 +- heed/src/env.rs | 3 ++- heed/src/lib.rs | 8 ++++---- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/heed-types/src/integer.rs b/heed-types/src/integer.rs index c5ec8b11..e4d91df2 100644 --- a/heed-types/src/integer.rs +++ b/heed-types/src/integer.rs @@ -65,9 +65,9 @@ the platform's native endianness. `", stringify!($name), "` implements [`Zeroable`], and [`Pod`], making it useful for parsing and serialization. -[`new`]: crate::byteorder::", stringify!($name), "::new -[`get`]: crate::byteorder::", stringify!($name), "::get -[`set`]: crate::byteorder::", stringify!($name), "::set +[`new`]: crate::integer::", stringify!($name), "::new +[`get`]: crate::integer::", stringify!($name), "::get +[`set`]: crate::integer::", stringify!($name), "::set [`Zeroable`]: bytemuck::Zeroable [`Pod`]: bytemuck::Pod"), #[derive(Default, Copy, Clone, Eq, PartialEq, Hash)] diff --git a/heed-types/src/lib.rs b/heed-types/src/lib.rs index 8d2f8639..41a57be2 100644 --- a/heed-types/src/lib.rs +++ b/heed-types/src/lib.rs @@ -4,7 +4,7 @@ //! For specific types you can choose: //! - [`Str`] to store [`str`](primitive@str)s //! - [`Unit`] to store `()` types -//! - [`SerdeBincode`] or [`SerdeJson`] to store [`Serialize`]/[`Deserialize`] types +//! - [`SerdeBincode`] or [`SerdeJson`] to store [`serde::Serialize`]/[`serde::Deserialize`] types //! //! But if you want to store big types that can be efficiently deserialized then //! here is a little table to help you in your quest: diff --git a/heed-types/src/str.rs b/heed-types/src/str.rs index 80147b86..62d8e92b 100644 --- a/heed-types/src/str.rs +++ b/heed-types/src/str.rs @@ -5,7 +5,7 @@ use heed_traits::{BytesDecode, BytesEncode}; use crate::UnalignedSlice; -/// Describes an [`str`]. +/// Describes an [`prim@str`]. pub struct Str<'a> { _phantom: marker::PhantomData<&'a ()>, } diff --git a/heed/src/env.rs b/heed/src/env.rs index a0ad873f..424708ea 100644 --- a/heed/src/env.rs +++ b/heed/src/env.rs @@ -99,7 +99,8 @@ impl EnvOpenOptions { self } - /// Set one or more LMDB flags (see http://www.lmdb.tech/doc/group__mdb__env.html). + /// Set one or [more LMDB flags](http://www.lmdb.tech/doc/group__mdb__env.html). + /// /// ``` /// use std::fs; /// use std::path::Path; diff --git a/heed/src/lib.rs b/heed/src/lib.rs index 950fa6a1..891aea66 100644 --- a/heed/src/lib.rs +++ b/heed/src/lib.rs @@ -1,11 +1,11 @@ //! Crate `heed` is a high-level wrapper of [LMDB], high-level doesn't mean heavy (think about Rust). //! //! It provides you a way to store types in LMDB without any limit and with a minimal overhead as possible, -//! relying on the [zerocopy] library to avoid copying bytes when that's unnecessary and the serde library +//! relying on the [bytemuck] library to avoid copying bytes when that's unnecessary and the serde library //! when this is unavoidable. //! //! The Lightning Memory-Mapped Database (LMDB) directly maps files parts into main memory, combined -//! with the zerocopy library allows us to safely zero-copy parse and serialize Rust types into LMDB. +//! with the bytemuck library allows us to safely zero-copy parse and serialize Rust types into LMDB. //! //! [LMDB]: https://en.wikipedia.org/wiki/Lightning_Memory-Mapped_Database //! @@ -21,8 +21,8 @@ //! use heed::types::*; //! //! # fn main() -> Result<(), Box> { -//! fs::create_dir_all(Path::new("target").join("zerocopy.mdb"))?; -//! let env = EnvOpenOptions::new().open(Path::new("target").join("zerocopy.mdb"))?; +//! fs::create_dir_all(Path::new("target").join("bytemuck.mdb"))?; +//! let env = EnvOpenOptions::new().open(Path::new("target").join("bytemuck.mdb"))?; //! //! // we will open the default unamed database //! let db: Database> = env.create_database(None)?;