Skip to content

Commit

Permalink
containers: impl DerefMut for Bindle
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Dec 25, 2023
1 parent dbd5f51 commit d8a1161
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/containers/bindle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
use std::collections::BTreeMap;
use std::fmt::{Debug, Display};
use std::io::{self, Read};
use std::ops::Deref;
use std::ops::{Deref, DerefMut};
use std::str::FromStr;

use amplify::confinement::{self, Confined, TinyVec, U24};
Expand Down Expand Up @@ -155,6 +155,10 @@ impl<C: BindleContent> Deref for Bindle<C> {
fn deref(&self) -> &Self::Target { &self.data }
}

impl<C: BindleContent> DerefMut for Bindle<C> {
fn deref_mut(&mut self) -> &mut Self::Target { &mut self.data }
}

impl<C: BindleContent> From<C> for Bindle<C> {
fn from(data: C) -> Self { Bindle::new(data) }
}
Expand Down

0 comments on commit d8a1161

Please sign in to comment.