diff --git a/src/db.rs b/src/db.rs index b871d87..16fec63 100644 --- a/src/db.rs +++ b/src/db.rs @@ -1027,8 +1027,8 @@ impl DB { self.get_pinned_cf_opt(cf, key, &ReadOptions::default()) } - pub fn create_cf(&self, name: &str, opts: &Options) -> Result { - let cname = match CString::new(name.as_bytes()) { + pub fn create_cf>(&self, name: N, opts: &Options) -> Result { + let cname = match CString::new(name.as_ref().as_bytes()) { Ok(c) => c, Err(_) => { return Err(Error::new( @@ -1048,7 +1048,7 @@ impl DB { self.cfs .write() .map_err(|e| Error::new(e.to_string()))? - .insert(name.to_string(), cf_handle); + .insert(name.as_ref().to_string(), cf_handle); ColumnFamily { inner: cf_handle,