Skip to content

Commit

Permalink
derive serde serialisation for Seq
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-k committed Sep 23, 2024
1 parent 3e49f81 commit d068352
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bio-seq/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ serde = { version = "1", optional = true, features=["derive"] }
serde_derive = { version = "1", optional = true }

[features]
serde = ["dep:serde", "dep:serde_derive"]
serde = ["dep:serde", "dep:serde_derive", "bitvec/serde"]
translation = []

#[[example]]
Expand Down
5 changes: 5 additions & 0 deletions bio-seq/src/seq/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ use crate::codec::{text, Codec};
use crate::error::ParseBioError;

use crate::{Bs, Bv, Order};

use bitvec::field::BitField;
use bitvec::view::BitView;

#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};

use core::borrow::Borrow;
use core::fmt;
//use core::hash::Hash;
Expand All @@ -56,6 +60,7 @@ use core::str::FromStr;
///
/// Stored on the heap
#[derive(Debug, Eq, PartialEq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[repr(transparent)]
pub struct Seq<A: Codec> {
pub(crate) _p: PhantomData<A>,
Expand Down

0 comments on commit d068352

Please sign in to comment.