From 9ecd0ea3d84026ef28f50743b4acf1f057082e8b Mon Sep 17 00:00:00 2001 From: Avril Date: Wed, 27 Apr 2022 21:57:29 +0100 Subject: [PATCH] Fixed silly bug preventing building on rust-stable. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for collect's current commit: Small blessing − 小吉 --- Cargo.toml | 2 +- src/memfile/map.rs | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fbfc232..0229e6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collect" -version = "1.0.0" +version = "1.0.1" description = "collect all of stdin until it is closed, then output it all to stdout" keywords = ["shell", "pipe", "utility", "unix", "linux"] authors = ["Avril "] diff --git a/src/memfile/map.rs b/src/memfile/map.rs index 8300d88..d76488c 100644 --- a/src/memfile/map.rs +++ b/src/memfile/map.rs @@ -10,13 +10,21 @@ use libc::{ }; //TODO: Make this a `bitflags` struct. -#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Copy, Default)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Copy)] #[repr(i32)] pub enum MapProtection { - #[default] None = PROT_NONE, Read = PROT_READ, Write = PROT_WRITE, Execute = PROT_EXEC, } + +impl Default for MapProtection +{ + #[inline(always)] + fn default() -> Self + { + Self::None + } +}