Skip to content

Commit

Permalink
fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsing committed Sep 13, 2024
1 parent 60e32f7 commit e3f163d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/db/kv/btree_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ use std::collections::BTreeMap;
use std::convert::Infallible;
use std::fmt::Debug;

/// A simple in-memory key-value store backed by a `BTreeMap`.
/// A simple in-memory key-value store backed by a [`BTreeMap`].
///
/// It's intended to be not `Clone`, since [`Clone::clone`] will clone the entire [`BTreeMap`].
/// [`BTreeMap`] could be faster than [`HashMap`](std::collections::HashMap) in small size.
///
/// It's intended to be not [`Clone`], since [`Clone::clone`] will clone the entire [`BTreeMap`].
///
/// If you need to clone the entire database,
/// you can use [`BTreeMapDb::inner`] to get the inner [`BTreeMap`],
Expand Down
6 changes: 3 additions & 3 deletions src/db/kv/hash_map.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! KVDatabase in-memory implementation using a [`BTreeMap`].
//! KVDatabase in-memory implementation using a [`HashMap`](std::collections::HashMap).
use super::KVDatabase;
use crate::HashMap;
use std::convert::Infallible;
use std::fmt::Debug;

/// A simple in-memory key-value store backed by a `HashMap`.
/// A simple in-memory key-value store backed by a [`HashMap`](std::collections::HashMap).
///
/// It's intended to be not `Clone`, since [`Clone::clone`] will clone the entire [`HashMapDb`].
/// It's intended to be not [`Clone`], since [`Clone::clone`] will clone the entire [`HashMapDb`].
///
/// If you need to clone the entire database,
/// you can use [`HashMapDb::inner`] to get the inner [`HashMapDb`],
Expand Down
4 changes: 2 additions & 2 deletions src/db/kv/sled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! Different from [`HashMapDb`](crate::db::HashMapDb) and [`BTreeMapDb`](crate::db::BTreeMapDb),
//! [`SledDb`] is `Clone`, since [`sled::Tree`] is `Clone`.
//! Same db is shared between different instances of `SledDb`.
//! Same db is shared between different instances of [`SledDb`].
//!
//! ## Example
//!
Expand All @@ -28,7 +28,7 @@
use super::KVDatabase;
use sled::Batch;

/// A key-value store backed by `sled`.
/// A key-value store backed by [`sled`].
#[derive(Clone, Debug)]
pub struct SledDb {
db: sled::Tree,
Expand Down

0 comments on commit e3f163d

Please sign in to comment.