diff options
| author | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2019-11-16 11:14:10 +0100 |
|---|---|---|
| committer | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2019-11-16 11:14:10 +0100 |
| commit | e16769c9b16223c491766f9c9b2c828ee2253ed4 (patch) | |
| tree | d1a6e68acc5bbb14d9f1e6bf65d7549916ff95b9 /src/config_list.rs | |
| parent | 084675fdfe1329cbd58a48f2306b7c61dec08834 (diff) | |
| download | mail-e16769c9b16223c491766f9c9b2c828ee2253ed4.tar.gz | |
less unwraps
Diffstat (limited to 'src/config_list.rs')
| -rw-r--r-- | src/config_list.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/config_list.rs b/src/config_list.rs index 632603c..b819418 100644 --- a/src/config_list.rs +++ b/src/config_list.rs @@ -6,7 +6,7 @@ use ffi; use Database; use Filenames; use FilenamesOwner; -use utils::{ScopedSupercow, ScopedPhantomcow}; +use utils::{ToStr, ScopedSupercow, ScopedPhantomcow}; #[derive(Debug)] @@ -46,15 +46,15 @@ impl<'d> Iterator for ConfigList<'d> } let (k, v) = unsafe { - let key = CStr::from_ptr(ffi::notmuch_config_list_key(self.ptr)); - let value = CStr::from_ptr(ffi::notmuch_config_list_value(self.ptr)); + let key = ffi::notmuch_config_list_key(self.ptr); + let value = ffi::notmuch_config_list_value(self.ptr); ffi::notmuch_config_list_move_to_next(self.ptr); (key, value) }; - Some((k.to_str().unwrap().to_string(), v.to_str().unwrap().to_string())) + Some((k.to_string_lossy().to_string(), v.to_string_lossy().to_string())) } } |
