@@ -24,8 +24,8 @@ pub struct Version(libc::c_uint);
24
24
pub struct Database ( * mut ffi:: notmuch_database_t ) ;
25
25
26
26
impl Database {
27
- pub fn create < P : path:: AsPath > ( path : & P ) -> Result < Database > {
28
- let path = path. as_path ( ) . to_cstring ( ) . unwrap ( ) ;
27
+ pub fn create < P : AsRef < path:: Path > > ( path : & P ) -> Result < Database > {
28
+ let path = path. as_ref ( ) . to_cstring ( ) . unwrap ( ) ;
29
29
30
30
let mut db = ptr:: null_mut ( ) ;
31
31
try!( unsafe {
@@ -35,8 +35,8 @@ impl Database {
35
35
Ok ( Database ( db) )
36
36
}
37
37
38
- pub fn open < P : path:: AsPath > ( path : & P , mode : Mode ) -> Result < Database > {
39
- let path = path. as_path ( ) . to_cstring ( ) . unwrap ( ) ;
38
+ pub fn open < P : AsRef < path:: Path > > ( path : & P , mode : Mode ) -> Result < Database > {
39
+ let path = path. as_ref ( ) . to_cstring ( ) . unwrap ( ) ;
40
40
41
41
let mut db = ptr:: null_mut ( ) ;
42
42
try!( unsafe {
@@ -56,20 +56,20 @@ impl Database {
56
56
Ok ( ( ) )
57
57
}
58
58
59
- pub fn compact < P : path:: AsPath , F : FnMut ( & str ) > (
59
+ pub fn compact < P : AsRef < path:: Path > , F : FnMut ( & str ) > (
60
60
path : & P , backup_path : Option < & P > ,
61
61
) -> Result < ( ) > {
62
62
let status: Option < F > = None ;
63
63
Database :: _compact ( path, backup_path, status)
64
64
}
65
65
66
- pub fn compact_with_status < P : path:: AsPath , F : FnMut ( & str ) > (
66
+ pub fn compact_with_status < P : AsRef < path:: Path > , F : FnMut ( & str ) > (
67
67
path : & P , backup_path : Option < & P > , status : F ,
68
68
) -> Result < ( ) > {
69
69
Database :: _compact ( path, backup_path, Some ( status) )
70
70
}
71
71
72
- fn _compact < P : path:: AsPath , F : FnMut ( & str ) > (
72
+ fn _compact < P : AsRef < path:: Path > , F : FnMut ( & str ) > (
73
73
path : & P , backup_path : Option < & P > , status : Option < F > ,
74
74
) -> Result < ( ) > {
75
75
@@ -82,9 +82,9 @@ impl Database {
82
82
}
83
83
}
84
84
85
- let path = path. as_path ( ) . to_cstring ( ) . unwrap ( ) ;
85
+ let path = path. as_ref ( ) . to_cstring ( ) . unwrap ( ) ;
86
86
let backup_path = backup_path. map ( |p| {
87
- p. as_path ( ) . to_cstring ( ) . unwrap ( )
87
+ p. as_ref ( ) . to_cstring ( ) . unwrap ( )
88
88
} ) ;
89
89
90
90
try!( unsafe {
0 commit comments