Skip to content

Commit

Permalink
cram/record/builder: Deprecate add methods
Browse files Browse the repository at this point in the history
Use the setters instead.
  • Loading branch information
zaeleus committed Oct 23, 2023
1 parent 3fe2301 commit edee012
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions noodles-cram/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## Unreleased

### Deprecated

* cram/record/builder Deprecate add methods: `Builder::add_tag`,
`Builder::add_base`, `Builder::add_feature`, and
`Builder::add_quality_score`.

Use the setters instead.

## 0.46.0 - 2023-10-23

### Changed
Expand Down
4 changes: 4 additions & 0 deletions noodles-cram/src/record/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ impl Builder {
}

/// Adds a tag to the tag dictionary.
#[deprecated(since = "0.47.0", note = "Use `Builder::set_tags` instead.")]
pub fn add_tag(
mut self,
tag: sam::record::data::field::Tag,
Expand All @@ -130,6 +131,7 @@ impl Builder {
}

/// Adds a base to the read bases.
#[deprecated(since = "0.47.0", note = "Use `Builder::set_bases` instead.")]
pub fn add_base(mut self, base: Base) -> Self {
self.bases.push(base);
self
Expand All @@ -142,6 +144,7 @@ impl Builder {
}

/// Adds a read feature.
#[deprecated(since = "0.47.0", note = "Use `Builder::set_features` instead.")]
pub fn add_feature(mut self, feature: Feature) -> Self {
self.features.push(feature);
self
Expand All @@ -160,6 +163,7 @@ impl Builder {
}

/// Adds a quality score.
#[deprecated(since = "0.47.0", note = "Use `Builder::set_quality_scores` instead.")]
pub fn add_quality_score(mut self, score: u8) -> Self {
self.quality_scores.as_mut().push(score);
self
Expand Down

0 comments on commit edee012

Please sign in to comment.