Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove the writer reference requirement #384

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ const fn bits_of<T>() -> usize {
}

/// Container to use with `to_writer`
pub struct Writer<'a, W: Write> {
pub(crate) inner: &'a mut W,
pub struct Writer<W: Write> {
pub(crate) inner: W,
/// Leftover bits
pub leftover: BitVec<u8, Msb0>,
/// Total bits written
pub bits_written: usize,
}

impl<'a, W: Write> Writer<'a, W> {
impl<W: Write> Writer<W> {
/// Create a new `Writer`
#[inline]
pub fn new(inner: &'a mut W) -> Self {
pub fn new(inner: W) -> Self {
Self {
inner,
leftover: BitVec::new(),
Expand Down
Loading