File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -408,6 +408,7 @@ impl<'a> Binary<'a> {
408408 /// If `offset + length` is out of bounds, this call results in *undefined behavior*. The
409409 /// caller has to ensure that `offset + length < self.len()`.
410410 #[ allow( unused_unsafe) ]
411+ #[ inline]
411412 pub unsafe fn make_subbinary_unchecked ( & self , offset : usize , length : usize ) -> Binary < ' a > {
412413 let raw_term = unsafe {
413414 enif_make_sub_binary (
@@ -438,7 +439,6 @@ impl Deref for Binary<'_> {
438439 self . as_slice ( )
439440 }
440441}
441-
442442impl < ' a > Decoder < ' a > for Binary < ' a > {
443443 fn decode ( term : Term < ' a > ) -> Result < Self , Error > {
444444 Binary :: from_term ( term)
@@ -473,6 +473,13 @@ impl<'a> Term<'a> {
473473 }
474474}
475475
476+ impl < ' a > From < Binary < ' a > > for Term < ' a > {
477+ #[ inline]
478+ fn from ( binary : Binary < ' a > ) -> Self {
479+ binary. term
480+ }
481+ }
482+
476483/// An newly-created, mutable Erlang binary.
477484///
478485/// See [module-level doc](index.html) for more information.
You can’t perform that action at this time.
0 commit comments