sqlite::open() takes an AsRef<Path> value

Now we can pass either a string or a Path to it, just like to
std::fs::File::open().
This commit is contained in:
Tomoki Aonuma
2015-06-19 13:10:22 +09:00
parent d155b7d33d
commit 423ecac84a
2 changed files with 3 additions and 3 deletions

View File

@ -99,7 +99,7 @@ pub type Result<T> = ::std::result::Result<T, Error>;
/// Open a connection to a new or existing database.
#[inline]
pub fn open<'l>(path: &std::path::Path) -> Result<Database<'l>> {
pub fn open<'l, P: std::convert::AsRef<std::path::Path>>(path: P) -> Result<Database<'l>> {
Database::open(path)
}