From 6253e97717d0db91912405ea8e5725dd6d240765 Mon Sep 17 00:00:00 2001 From: k-nasa Date: Tue, 1 Oct 2019 16:52:10 +0900 Subject: [PATCH] feat: Add Default trait --- src/fs/dir_builder.rs | 2 +- src/fs/open_options.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fs/dir_builder.rs b/src/fs/dir_builder.rs index 0de230d..3064f7a 100644 --- a/src/fs/dir_builder.rs +++ b/src/fs/dir_builder.rs @@ -14,7 +14,7 @@ use crate::task::blocking; /// /// [`os::unix::fs::DirBuilderExt`]: ../os/unix/fs/trait.DirBuilderExt.html /// [`std::fs::DirBuilder`]: https://doc.rust-lang.org/std/fs/struct.DirBuilder.html -#[derive(Debug)] +#[derive(Debug, Default)] pub struct DirBuilder { /// Set to `true` if non-existent parent directories should be created. recursive: bool, diff --git a/src/fs/open_options.rs b/src/fs/open_options.rs index c6cc74a..252873c 100644 --- a/src/fs/open_options.rs +++ b/src/fs/open_options.rs @@ -290,6 +290,12 @@ impl OpenOptions { } } +impl Default for OpenOptions { + fn default() -> Self { + Self::new() + } +} + cfg_if! { if #[cfg(feature = "docs")] { use crate::os::unix::fs::OpenOptionsExt;