Skip to content

Commit

Permalink
feat(service/sled): fix code
Browse files Browse the repository at this point in the history
Signed-off-by: owl <[email protected]>
  • Loading branch information
oowl committed Jun 23, 2023
1 parent 3240d55 commit 84096c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/services/sled/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use std::collections::HashMap;
use std::fmt::Debug;
use std::fmt::Formatter;
use std::str;

use async_trait::async_trait;

Expand All @@ -28,6 +29,9 @@ use crate::ErrorKind;
use crate::Scheme;
use crate::*;

// https://github.com/spacejam/sled/blob/69294e59c718289ab3cb6bd03ac3b9e1e072a1e7/src/db.rs#L5
const DEFAULT_TREE_ID: &str = r#"__sled__default"#;

/// Sled service support.
#[doc = include_str!("docs.md")]
#[derive(Default)]
Expand Down Expand Up @@ -88,7 +92,7 @@ impl Builder for SledBuilder {
// use "default" tree if not set
let tree_name = match self.tree.take() {
Some(tree) => tree,
None => "default".into(),
None => DEFAULT_TREE_ID.to_string(),
};

let tree = db.open_tree(&tree_name).map_err(|e| {
Expand Down

0 comments on commit 84096c5

Please sign in to comment.