Skip to content

Commit

Permalink
Fix some doc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerollmops committed Jan 17, 2021
1 parent 30321cf commit d7a6598
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions heed-types/src/integer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion heed-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion heed-types/src/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()>,
}
Expand Down
3 changes: 2 additions & 1 deletion heed/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions heed/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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
//!
Expand All @@ -21,8 +21,8 @@
//! use heed::types::*;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! 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<Str, OwnedType<i32>> = env.create_database(None)?;
Expand Down

0 comments on commit d7a6598

Please sign in to comment.