Skip to content

Commit

Permalink
Make sure all filters are clonable (#75)
Browse files Browse the repository at this point in the history
No reason to have them not be AFAICT and makes certain things easier
(e.g. if the filter is part of a data structure whose ownership is
being transferred but you want to keep a copy of the filter).
  • Loading branch information
vlovich committed Oct 30, 2023
1 parent def7fcd commit 460b336
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/bfuse16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ use bincode::{Decode, Encode};
/// [`serde`]: http://serde.rs
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct BinaryFuse16 {
seed: u64,
segment_length: u32,
Expand Down
2 changes: 1 addition & 1 deletion src/bfuse32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ use bincode::{Decode, Encode};
/// [`serde`]: http://serde.rs
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct BinaryFuse32 {
seed: u64,
segment_length: u32,
Expand Down
2 changes: 1 addition & 1 deletion src/bfuse8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ use bincode::{Decode, Encode};
/// [`serde`]: http://serde.rs
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct BinaryFuse8 {
seed: u64,
segment_length: u32,
Expand Down
2 changes: 1 addition & 1 deletion src/fuse16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ use bincode::{Decode, Encode};
#[deprecated(since = "0.8.0", note = "prefer using a `BinaryFuse16`")]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Fuse16 {
/// The seed for the filter
pub seed: u64,
Expand Down
2 changes: 1 addition & 1 deletion src/fuse32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ use bincode::{Decode, Encode};
#[deprecated(since = "0.8.0", note = "prefer using a `BinaryFuse32`")]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Fuse32 {
/// The seed for the filter
pub seed: u64,
Expand Down
2 changes: 1 addition & 1 deletion src/fuse8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ use bincode::{Decode, Encode};
#[deprecated(since = "0.8.0", note = "prefer using a `BinaryFuse8`")]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct Fuse8 {
/// The seed for the filter
pub seed: u64,
Expand Down
1 change: 1 addition & 0 deletions src/xor16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ use bincode::{Decode, Encode};
/// [`serde`]: http://serde.rs
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
#[derive(Debug, Clone)]
pub struct Xor16 {
/// The seed for the filter
pub seed: u64,
Expand Down
1 change: 1 addition & 0 deletions src/xor32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ use bincode::{Decode, Encode};
/// [`serde`]: http://serde.rs
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
#[derive(Debug, Clone)]
pub struct Xor32 {
/// The seed for the filter
pub seed: u64,
Expand Down
1 change: 1 addition & 0 deletions src/xor8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ use bincode::{Decode, Encode};
/// [`serde`]: http://serde.rs
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
#[derive(Debug, Clone)]
pub struct Xor8 {
/// The seed for the filter
pub seed: u64,
Expand Down

0 comments on commit 460b336

Please sign in to comment.