File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,8 +12,9 @@ edition = "2024"
1212
1313[dependencies ]
1414unicode-width = { version = " 0.2" , optional = true }
15- bytes = " 1"
15+ bytes = { version = " 1" , optional = true }
1616
1717[features ]
1818default = []
1919pretty-print = [" unicode-width" ]
20+ with-bytes = [" bytes" ]
Original file line number Diff line number Diff line change @@ -705,6 +705,7 @@ impl From<Bufferfish> for Vec<u8> {
705705 }
706706}
707707
708+ #[ cfg( feature = "bytes" ) ]
708709impl From < bytes:: Bytes > for Bufferfish {
709710 fn from ( bytes : bytes:: Bytes ) -> Self {
710711 Self {
@@ -715,12 +716,14 @@ impl From<bytes::Bytes> for Bufferfish {
715716 }
716717}
717718
719+ #[ cfg( feature = "bytes" ) ]
718720impl From < Bufferfish > for bytes:: Bytes {
719721 fn from ( buffer : Bufferfish ) -> Self {
720722 bytes:: Bytes :: from ( buffer. inner . into_inner ( ) )
721723 }
722724}
723725
726+ #[ cfg( feature = "bytes" ) ]
724727impl From < & Bufferfish > for bytes:: Bytes {
725728 fn from ( buffer : & Bufferfish ) -> Self {
726729 bytes:: Bytes :: copy_from_slice ( buffer. as_ref ( ) )
You can’t perform that action at this time.
0 commit comments