Skip to content

Commit

Permalink
bgzf: Deprecate AsyncReader re-export
Browse files Browse the repository at this point in the history
Use `bgzf::r#async::Reader` instead.
  • Loading branch information
zaeleus committed Jan 14, 2025
1 parent 6959a3d commit 08d44bc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
6 changes: 6 additions & 0 deletions noodles-bgzf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

* bgzf: Raise minimum supported Rust version (MSRV) to 1.73.0.

### Deprecated

* bgzf: Deprecate `AsyncReader` re-export.

Use `bgzf::r#async::Reader` instead.

## 0.34.0 - 2024-12-12

### Added
Expand Down
18 changes: 9 additions & 9 deletions noodles-bgzf/src/async/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ where
/// ```
/// use noodles_bgzf as bgzf;
/// use tokio::io;
/// let reader = bgzf::AsyncReader::new(io::empty());
/// let reader = bgzf::r#async::Reader::new(io::empty());
/// ```
pub fn new(inner: R) -> Self {
Builder::default().build_from_reader(inner)
Expand All @@ -57,7 +57,7 @@ where
/// ```
/// use noodles_bgzf as bgzf;
/// use tokio::io;
/// let reader = bgzf::AsyncReader::new(io::empty());
/// let reader = bgzf::r#async::Reader::new(io::empty());
/// let _inner = reader.get_ref();
/// ```
pub fn get_ref(&self) -> &R {
Expand All @@ -72,7 +72,7 @@ where
/// ```
/// use noodles_bgzf as bgzf;
/// use tokio::io;
/// let mut reader = bgzf::AsyncReader::new(io::empty());
/// let mut reader = bgzf::r#async::Reader::new(io::empty());
/// let _inner = reader.get_mut();
/// ```
pub fn get_mut(&mut self) -> &mut R {
Expand All @@ -88,7 +88,7 @@ where
/// # use std::pin::Pin;
/// use noodles_bgzf as bgzf;
/// use tokio::io;
/// let mut reader = bgzf::AsyncReader::new(io::empty());
/// let mut reader = bgzf::r#async::Reader::new(io::empty());
/// let _inner = Pin::new(&mut reader).get_pin_mut();
/// ```
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut R> {
Expand All @@ -103,7 +103,7 @@ where
/// ```
/// use noodles_bgzf as bgzf;
/// use tokio::io;
/// let reader = bgzf::AsyncReader::new(io::empty());
/// let reader = bgzf::r#async::Reader::new(io::empty());
/// let _inner = reader.into_inner();
/// ```
pub fn into_inner(self) -> R {
Expand All @@ -118,7 +118,7 @@ where
/// ```
/// use noodles_bgzf as bgzf;
/// use tokio::io;
/// let reader = bgzf::AsyncReader::new(io::empty());
/// let reader = bgzf::r#async::Reader::new(io::empty());
/// assert_eq!(reader.position(), 0);
/// ```
pub fn position(&self) -> u64 {
Expand All @@ -132,7 +132,7 @@ where
/// ```
/// use noodles_bgzf as bgzf;
/// use tokio::io;
/// let reader = bgzf::AsyncReader::new(io::empty());
/// let reader = bgzf::r#async::Reader::new(io::empty());
/// assert_eq!(reader.virtual_position(), bgzf::VirtualPosition::from(0));
/// ```
pub fn virtual_position(&self) -> VirtualPosition {
Expand All @@ -153,7 +153,7 @@ where
/// # async fn main() -> tokio::io::Result<()> {
/// use noodles_bgzf as bgzf;
/// use tokio::io;
/// let mut reader = bgzf::AsyncReader::new(io::empty());
/// let mut reader = bgzf::r#async::Reader::new(io::empty());
/// reader.seek(bgzf::VirtualPosition::MIN).await?;
/// # Ok(())
/// # }
Expand Down Expand Up @@ -195,7 +195,7 @@ where
/// use noodles_bgzf::{self as bgzf, gzi};
/// use tokio::io;
///
/// let mut reader = bgzf::AsyncReader::new(io::empty());
/// let mut reader = bgzf::r#async::Reader::new(io::empty());
///
/// let index = gzi::Index::from(vec![(0, 0)]);
/// reader.seek_by_uncompressed_position(&index, 0).await?;
Expand Down
6 changes: 5 additions & 1 deletion noodles-bgzf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ pub use self::{
};

#[cfg(feature = "async")]
pub use self::r#async::{Reader as AsyncReader, Writer as AsyncWriter};
#[deprecated(since = "0.35.0", note = "Use `bgzf::r#async::Reader` instead.")]
pub use self::r#async::Reader as AsyncReader;

#[cfg(feature = "async")]
pub use self::r#async::Writer as AsyncWriter;

use self::block::Block;

Expand Down

0 comments on commit 08d44bc

Please sign in to comment.