Skip to content

Commit

Permalink
Merge pull request #72 from Enet4/remove-deprecated-0.8.0
Browse files Browse the repository at this point in the history
Remove stuff that was deprecated since 0.8.0
  • Loading branch information
Enet4 authored Jul 4, 2020
2 parents 963972e + 59245ff commit 434ad84
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 46 deletions.
29 changes: 0 additions & 29 deletions src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,13 @@ const PREALLOC_MAX_SIZE: usize = 1 << 25; // 32M
pub struct Extender([u8; 4]);

impl Extender {
/// Fetch the extender code from the given source, while expecting it to exist.
#[deprecated(since = "0.8.0", note = "use `from_reader` instead")]
pub fn from_stream<S: Read>(source: S) -> Result<Self> {
Self::from_reader(source)
}

/// Fetch the extender code from the given source, while expecting it to exist.
pub fn from_reader<S: Read>(mut source: S) -> Result<Self> {
let mut extension = [0u8; 4];
source.read_exact(&mut extension)?;
Ok(extension.into())
}

/// Fetch the extender code from the given source, while
/// being possible to not be available.
/// Returns `None` if the source reaches EoF prematurely.
/// Any other I/O error is delegated to a `NiftiError`.
#[deprecated(since = "0.8.0", note = "use `from_reader_optional` instead")]
pub fn from_stream_optional<S: Read>(source: S) -> Result<Option<Self>> {
Self::from_reader_optional(source)
}

/// Fetch the extender code from the given source, while
/// being possible to not be available.
/// Returns `None` if the source reaches EoF prematurely.
Expand Down Expand Up @@ -148,20 +133,6 @@ impl<'a> IntoIterator for &'a ExtensionSequence {
}

impl ExtensionSequence {
/// Read a sequence of extensions from a source, up until `len` bytes.
#[deprecated(since = "0.8.0", note = "use `from_reader` instead")]
pub fn from_stream<S, E>(
extender: Extender,
source: ByteOrdered<S, E>,
len: usize,
) -> Result<Self>
where
S: Read,
E: Endian,
{
Self::from_reader(extender, source, len)
}

/// Read a sequence of extensions from a source, up until `len` bytes.
pub fn from_reader<S, E>(
extender: Extender,
Expand Down
8 changes: 0 additions & 8 deletions src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,6 @@ impl NiftiHeader {
}
}

/// Read a NIfTI-1 header, along with its byte order, from the given byte stream.
/// It is assumed that the input is currently at the start of the
/// NIFTI header.
#[deprecated(since = "0.8.0", note = "use `from_reader` instead")]
pub fn from_stream<S: Read>(input: S) -> Result<NiftiHeader> {
Self::from_reader(input)
}

/// Read a NIfTI-1 header, along with its byte order, from the given byte stream.
/// It is assumed that the input is currently at the start of the
/// NIFTI header.
Expand Down
9 changes: 0 additions & 9 deletions src/volume/inmem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,6 @@ impl InMemNiftiVolume {
})
}

/// Read a NIFTI volume from a stream of data. The header and expected byte order
/// of the volume's data must be known in advance. It it also expected that the
/// following bytes represent the first voxels of the volume (and not part of the
/// extensions).
#[deprecated(since = "0.8.0", note = "use `from_reader` instead")]
pub fn from_stream<R: Read>(source: R, header: &NiftiHeader) -> Result<Self> {
Self::from_reader(source, header)
}

/// Read a NIFTI volume from a stream of data. The header and expected byte order
/// of the volume's data must be known in advance. It it also expected that the
/// following bytes represent the first voxels of the volume (and not part of the
Expand Down

0 comments on commit 434ad84

Please sign in to comment.