Skip to content

Commit

Permalink
bgzf/writer/compression_level: Add a const getter
Browse files Browse the repository at this point in the history
  • Loading branch information
zaeleus committed May 16, 2024
1 parent b3190ae commit 633bf00
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions noodles-bgzf/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## Unreleased

### Added

* bgzf/writer/compression_level: Add a `const` getter
(`CompressionLevel::get`).

## 0.29.0 - 2024-05-02

### Added
Expand Down
12 changes: 12 additions & 0 deletions noodles-bgzf/src/writer/compression_level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ impl CompressionLevel {
}
}

/// Returns the inner value.
///
/// # Examples
///
/// ```
/// use noodles_bgzf::writer::CompressionLevel;
/// assert_eq!(CompressionLevel::NONE.get(), 0);
/// ```
pub const fn get(&self) -> u8 {
self.0
}

/// Returns a compression level to disable compression.
///
/// # Examples
Expand Down

0 comments on commit 633bf00

Please sign in to comment.