diff options
author | Cody P Schafer <dev@codyps.com> | 2020-09-10 23:02:28 -0400 |
---|---|---|
committer | Cody P Schafer <dev@codyps.com> | 2020-09-10 23:02:28 -0400 |
commit | 840c68e558f4f9eaa886ec8d16151161718db6e0 (patch) | |
tree | 3b05a1888e17083a259d9687bd5b44628fe6015f /zfs-core | |
parent | 820f14a7b32e1fe81c9ae90dc796ba90e43cbff7 (diff) | |
download | rust-libzfs-840c68e558f4f9eaa886ec8d16151161718db6e0.zip |
zfs-core: rust_2018_idioms
Diffstat (limited to 'zfs-core')
-rw-r--r-- | zfs-core/src/lib.rs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/zfs-core/src/lib.rs b/zfs-core/src/lib.rs index ba57a5a..28e14c0 100644 --- a/zfs-core/src/lib.rs +++ b/zfs-core/src/lib.rs @@ -1,14 +1,11 @@ -extern crate cstr_argument; -extern crate foreign_types; -extern crate nvpair; -extern crate zfs_core_sys as sys; +#![warn(missing_debug_implementations, rust_2018_idioms)] +use zfs_core_sys as sys; use cstr_argument::CStrArgument; use foreign_types::ForeignType; use nvpair::NvList; -use std::io; +use std::{io, ptr, fmt}; use std::marker::PhantomData; -use std::ptr; /// A handle to work with Zfs filesystems // Note: the Drop for this makes clone-by-copy unsafe. Could clone by just calling new(). @@ -20,6 +17,14 @@ pub struct Zfs { i: PhantomData<()>, } +impl fmt::Debug for Zfs { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Zfs") + .finish() + } +} + +#[derive(Debug)] pub enum DataSetType { Zfs, Zvol, |