diff --git a/lmdb-sys/build.rs b/lmdb-sys/build.rs index c88d061..5be0be0 100644 --- a/lmdb-sys/build.rs +++ b/lmdb-sys/build.rs @@ -4,7 +4,6 @@ extern crate "pkg-config" as pkg_config; extern crate gcc; use std::default::Default; -use std::os; use std::env; use std::path::PathBuf; diff --git a/src/environment.rs b/src/environment.rs index 4ac7cfb..14fb468 100644 --- a/src/environment.rs +++ b/src/environment.rs @@ -1,7 +1,8 @@ use libc::{c_uint, size_t, mode_t}; -use std::ffi::CString; +use std::ffi::{AsOsStr, CString}; +use std::os::unix::OsStrExt; use std::old_io::FilePermission; -use std::path::BytesContainer; +use std::path::Path; use std::ptr; use std::sync::Mutex; @@ -178,7 +179,7 @@ impl EnvironmentBuilder { ffi::mdb_env_close(env)) } lmdb_try_with_cleanup!(ffi::mdb_env_open(env, - CString::from_slice(path.container_as_bytes()).as_ptr(), + CString::from_slice(path.as_os_str().as_byte_slice()).as_ptr(), self.flags.bits(), mode.bits() as mode_t), ffi::mdb_env_close(env)); diff --git a/src/lib.rs b/src/lib.rs index 6f8637d..051b0e9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ //! Provides the minimal amount of abstraction necessary to interact with LMDB safely in Rust. In //! general, the API is very similar to the LMDB [C-API](http://symas.com/mdb/doc/). -#![feature(collections, core, hash, io, libc, optin_builtin_traits, path, std_misc, test, unsafe_destructor)] +#![feature(collections, core, hash, io, libc, optin_builtin_traits, std_misc, test, unsafe_destructor)] #![cfg_attr(test, feature(rand))] extern crate libc;