Skip to content

Commit 902866e

Browse files
committed
Implemented default for ShmemConf
1 parent 4287d37 commit 902866e

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[package]
22
name = "shared_memory"
33
description = "A user friendly crate that allows you to share memory between processes"
4-
version = "0.12.0"
4+
version = "0.12.1"
55
authors = ["ElasT0ny <elast0ny00@gmail.com>"]
66
license = "MIT OR Apache-2.0"
7-
edition = "2018"
7+
edition = "2021"
88

99
#Extra fields for crates.io
1010
readme = "README.md"

src/lib.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ impl Drop for ShmemConf {
6666
}
6767
}
6868
}
69-
#[allow(clippy::new_without_default)]
70-
impl ShmemConf {
71-
/// Create a new default shmem config
72-
pub fn new() -> Self {
69+
impl Default for ShmemConf {
70+
fn default() -> Self {
7371
Self {
7472
owner: false,
7573
os_id: None,
@@ -78,6 +76,12 @@ impl ShmemConf {
7876
size: 0,
7977
}
8078
}
79+
}
80+
impl ShmemConf {
81+
/// Create a new default shmem config
82+
pub fn new() -> Self {
83+
ShmemConf::default()
84+
}
8185
/// Provide a specific os identifier for the mapping
8286
///
8387
/// When not specified, a randomly generated identifier will be used

0 commit comments

Comments
 (0)