diff --git a/README.md b/README.md index cfded7a..373b993 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The package provides an interface to [SQLite][1]. ```rust use std::path::Path; -let database = sqlite::open(&Path::new(":memory:")).unwrap(); +let database = sqlite::open(":memory:").unwrap(); database.execute(r#" CREATE TABLE `users` (id INTEGER, name VARCHAR(255)); diff --git a/src/lib.rs b/src/lib.rs index 97d854d..3d3649d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ //! ``` //! use std::path::Path; //! -//! let database = sqlite::open(&Path::new(":memory:")).unwrap(); +//! let database = sqlite::open(":memory:").unwrap(); //! //! database.execute(r#" //! CREATE TABLE `users` (id INTEGER, name VARCHAR(255)); @@ -99,7 +99,7 @@ pub type Result = ::std::result::Result; /// Open a connection to a new or existing database. #[inline] -pub fn open<'l, P: std::convert::AsRef>(path: P) -> Result> { +pub fn open<'l, P: AsRef>(path: P) -> Result> { Database::open(path) } diff --git a/tests/lib.rs b/tests/lib.rs index 3485524..1cfec3b 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -9,13 +9,12 @@ macro_rules! ok( fn workflow() { use sqlite::Binding::*; use sqlite::State; - use std::path::Path; macro_rules! pair( ($one:expr, $two:expr) => (($one, Some($two))); ); - let database = ok!(sqlite::open(&Path::new(":memory:"))); + let database = ok!(sqlite::open(":memory:")); let sql = r#"CREATE TABLE `users` (id INTEGER, name VARCHAR(255), age REAL);"#; ok!(database.execute(sql));