diff --git a/Cargo.toml b/Cargo.toml index e359f75..d86e9da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,12 @@ [package] -name = "binary-utils" +name = "binary-util" version = "0.3.0" authors = ["NetrexMC"] edition = "2021" include = ["src/**/*", "README.md"] description = "A panic-free way to read/write binary streams in rust." license = "Apache-2.0" +repository = "https://github.com/NetrexMC/binary-util" [dependencies] codegen = { path = "./codegen", version = "0.1.0", optional = true } diff --git a/README.md b/README.md index 76c51ac..20bc8d5 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# binary_utils +# binary_util A panic-free way to read/write binary streams in rust. -[Documentation](https://docs.rs/binary_utils/) | +[Documentation](https://docs.rs/binary_util/) | [Discord](https://discord.gg/y4aWA5MQxK) ## Generic Usage ```rust -use binary_utils::{BinaryIo, BinaryReader, BinaryWriter}; +use binary_util::{BinaryIo, BinaryReader, BinaryWriter}; #[derive(BinaryIo)] pub struct MyStruct { @@ -30,4 +30,4 @@ fn main() { } ``` -For more examples and usage, please refer to the [Documentation](https://docs.rs/binary_utils/). \ No newline at end of file +For more examples and usage, please refer to the [Documentation](https://docs.rs/binary_util/). \ No newline at end of file diff --git a/codegen/src/io/enums.rs b/codegen/src/io/enums.rs index d629692..6cda70e 100644 --- a/codegen/src/io/enums.rs +++ b/codegen/src/io/enums.rs @@ -241,8 +241,8 @@ pub(crate) fn derive_enum( let read_streams = variants.iter().map(|variant| variant.read_content.clone()).collect::>(); quote! { - impl ::binary_utils::interfaces::Writer for #enum_name { - fn write(&self, _binary_writew: &mut ::binary_utils::io::ByteWriter) -> ::std::result::Result<(), ::std::io::Error> { + impl ::binary_util::interfaces::Writer for #enum_name { + fn write(&self, _binary_writew: &mut ::binary_util::io::ByteWriter) -> ::std::result::Result<(), ::std::io::Error> { match self { #(#write_streams)* }; @@ -251,8 +251,8 @@ pub(crate) fn derive_enum( } } - impl ::binary_utils::interfaces::Reader<#enum_name> for #enum_name { - fn read(_binary_readerr: &mut ::binary_utils::io::ByteReader) -> ::std::result::Result<#enum_name, ::std::io::Error> { + impl ::binary_util::interfaces::Reader<#enum_name> for #enum_name { + fn read(_binary_readerr: &mut ::binary_util::io::ByteReader) -> ::std::result::Result<#enum_name, ::std::io::Error> { match <#repr_type>::read(_binary_readerr)? { #(#read_streams)* _ => Err(::std::io::Error::new(::std::io::ErrorKind::InvalidData, "Invalid enum discriminant.")) diff --git a/codegen/src/io/mod.rs b/codegen/src/io/mod.rs index 18fd6ea..7536657 100644 --- a/codegen/src/io/mod.rs +++ b/codegen/src/io/mod.rs @@ -13,7 +13,7 @@ pub(crate) type AstContext<'a> = ( &'a syn::Visibility, ); -// BinaryEncoder is a derive macro that implements `::binary_utils::interfaces::Reader` and `::binary_utils::interfaces::Writer` +// BinaryEncoder is a derive macro that implements `::binary_util::interfaces::Reader` and `::binary_util::interfaces::Writer` pub(crate) fn binary_encoder(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveInput); let ctx: AstContext = (&input.ident, &input.attrs, &input.generics, &input.vis); diff --git a/codegen/src/io/structs.rs b/codegen/src/io/structs.rs index 29e5558..e95684c 100644 --- a/codegen/src/io/structs.rs +++ b/codegen/src/io/structs.rs @@ -78,7 +78,7 @@ pub(crate) fn derive_struct( error_stream.append_all( syn::Error::new_spanned( field, - "Cannot have more than one binary_utils Attribute on a single field!", + "Cannot have more than one binary_util Attribute on a single field!", ) .to_compile_error(), ); @@ -117,14 +117,14 @@ pub(crate) fn derive_struct( } } quote! { - impl ::binary_utils::interfaces::Writer for #struct_name { - fn write(&self, _binary_writew: &mut ::binary_utils::io::ByteWriter) -> Result<(), ::std::io::Error> { + impl ::binary_util::interfaces::Writer for #struct_name { + fn write(&self, _binary_writew: &mut ::binary_util::io::ByteWriter) -> Result<(), ::std::io::Error> { #writer Ok(()) } } - impl ::binary_utils::interfaces::Reader<#struct_name> for #struct_name { - fn read(_binary_readerr: &mut ::binary_utils::io::ByteReader) -> Result<#struct_name, ::std::io::Error> { + impl ::binary_util::interfaces::Reader<#struct_name> for #struct_name { + fn read(_binary_readerr: &mut ::binary_util::io::ByteReader) -> Result<#struct_name, ::std::io::Error> { // println!("impl Reader for {} called!\n-> {}", stringify!(#struct_name), stringify!(#reader)); #reader Ok(Self { @@ -153,7 +153,7 @@ pub(crate) fn derive_struct( error_stream.append_all( syn::Error::new_spanned( field, - "Cannot have more than one binary_utils Attribute on a field!", + "Cannot have more than one binary_util Attribute on a field!", ) .to_compile_error(), ); @@ -198,14 +198,14 @@ pub(crate) fn derive_struct( // .map(|i| syn::Ident::new(&format!("__unnamed_{}", i), proc_macro2::Span::call_site())) // .collect(); quote! { - impl ::binary_utils::interfaces::Writer for #struct_name { - fn write(&self, _binary_writew: &mut ::binary_utils::io::ByteWriter) -> ::std::result::Result<(), ::std::io::Error> { + impl ::binary_util::interfaces::Writer for #struct_name { + fn write(&self, _binary_writew: &mut ::binary_util::io::ByteWriter) -> ::std::result::Result<(), ::std::io::Error> { #writer Ok(()) } } - impl ::binary_utils::interfaces::Reader<#struct_name> for #struct_name { - fn read(_binary_readerr: &mut ::binary_utils::io::ByteReader) -> ::std::result::Result<#struct_name, ::std::io::Error> { + impl ::binary_util::interfaces::Reader<#struct_name> for #struct_name { + fn read(_binary_readerr: &mut ::binary_util::io::ByteReader) -> ::std::result::Result<#struct_name, ::std::io::Error> { // println!("impl Reader for {} called!\n-> {}", stringify!(#struct_name), stringify!(#reader)); #reader Ok(Self( @@ -218,7 +218,7 @@ pub(crate) fn derive_struct( Fields::Unit => { error_stream.append_all(syn::Error::new_spanned( ast_ctx.0, - "Unit structs are not supported by binary_utils because they have no fields to parse or write.\nThis may change in the future, but for now, please use the skip attribute." + "Unit structs are not supported by binary_util because they have no fields to parse or write.\nThis may change in the future, but for now, please use the skip attribute." ).to_compile_error()); return quote!().into(); } diff --git a/codegen/src/io/unions.rs b/codegen/src/io/unions.rs index 64864c1..684b31b 100644 --- a/codegen/src/io/unions.rs +++ b/codegen/src/io/unions.rs @@ -7,6 +7,6 @@ use super::AstContext; pub(crate) fn derive_union(ast_ctx: AstContext, _: DataUnion, _: &mut TokenStream2) -> TokenStream { syn::Error::new_spanned( ast_ctx.0, - "Unions are not supported by binary_utils, there is currently no way to implement the BinaryReader and BinaryWriter traits for unions." + "Unions are not supported by binary_util, there is currently no way to implement the BinaryReader and BinaryWriter traits for unions." ).to_compile_error().into() } diff --git a/codegen/src/legacy.rs b/codegen/src/legacy.rs index ca2416f..925d5d4 100644 --- a/codegen/src/legacy.rs +++ b/codegen/src/legacy.rs @@ -17,35 +17,35 @@ pub fn stream_parse(input: DeriveInput) -> Result { Ok(quote! { #[automatically_derived] impl Streamable<#name> for #name { - fn parse(&self) -> Result, ::binary_utils::error::BinaryError> { - use ::binary_utils::interfaces::{Reader, Writer}; - use ::binary_utils::io::ByteWriter; + fn parse(&self) -> Result, ::binary_util::error::BinaryError> { + use ::binary_util::interfaces::{Reader, Writer}; + use ::binary_util::io::ByteWriter; let mut writer = ByteWriter::new(); #writes Ok(writer.as_slice().to_vec()) } - fn compose(s: &[u8], position: &mut usize) -> Result { - use ::binary_utils::interfaces::{Reader, Writer}; + fn compose(s: &[u8], position: &mut usize) -> Result { + use ::binary_util::interfaces::{Reader, Writer}; use ::std::io::Read; - let mut source = ::binary_utils::io::ByteReader::from(s); + let mut source = ::binary_util::io::ByteReader::from(s); Ok(Self { #reads }) } } - impl ::binary_utils::interfaces::Writer for #name { - fn write(&self, writer: &mut ::binary_utils::io::ByteWriter) -> Result<(), ::std::io::Error> { - use ::binary_utils::interfaces::{Reader, Writer}; + impl ::binary_util::interfaces::Writer for #name { + fn write(&self, writer: &mut ::binary_util::io::ByteWriter) -> Result<(), ::std::io::Error> { + use ::binary_util::interfaces::{Reader, Writer}; #writes Ok(()) } } - impl ::binary_utils::interfaces::Reader<#name> for #name { - fn read(source: &mut ::binary_utils::io::ByteReader) -> Result { - use ::binary_utils::interfaces::{Reader, Writer}; + impl ::binary_util::interfaces::Reader<#name> for #name { + fn read(source: &mut ::binary_util::io::ByteReader) -> Result { + use ::binary_util::interfaces::{Reader, Writer}; // get the repr type and read it Ok(Self { #new_reads @@ -202,18 +202,18 @@ pub fn stream_parse(input: DeriveInput) -> Result { Ok(quote! { #[automatically_derived] - impl ::binary_utils::interfaces::Streamable<#name> for #name { - fn parse(&self) -> Result, ::binary_utils::error::BinaryError> { - use ::binary_utils::interfaces::{Reader, Writer}; + impl ::binary_util::interfaces::Streamable<#name> for #name { + fn parse(&self) -> Result, ::binary_util::error::BinaryError> { + use ::binary_util::interfaces::{Reader, Writer}; match self { #(#writers)* } } - fn compose(source: &[u8], offset: &mut usize) -> Result { - use ::binary_utils::interfaces::{Reader, Writer}; + fn compose(source: &[u8], offset: &mut usize) -> Result { + use ::binary_util::interfaces::{Reader, Writer}; // get the repr type and read it - let v = <#enum_ty>::read(&mut ::binary_utils::io::ByteReader::from(source))?; + let v = <#enum_ty>::read(&mut ::binary_util::io::ByteReader::from(source))?; match v { #(#readers)* @@ -222,18 +222,18 @@ pub fn stream_parse(input: DeriveInput) -> Result { } } - impl ::binary_utils::interfaces::Writer for #name { - fn write(&self, source: &mut ::binary_utils::io::ByteWriter) -> Result<(), ::std::io::Error> { - use ::binary_utils::interfaces::{Reader, Writer}; + impl ::binary_util::interfaces::Writer for #name { + fn write(&self, source: &mut ::binary_util::io::ByteWriter) -> Result<(), ::std::io::Error> { + use ::binary_util::interfaces::{Reader, Writer}; match self { #(#new_writers)* } } } - impl ::binary_utils::interfaces::Reader<#name> for #name { - fn read(source: &mut ::binary_utils::io::ByteReader) -> Result { - use ::binary_utils::interfaces::{Reader, Writer}; + impl ::binary_util::interfaces::Reader<#name> for #name { + fn read(source: &mut ::binary_util::io::ByteReader) -> Result { + use ::binary_util::interfaces::{Reader, Writer}; // get the repr type and read it let v = <#enum_ty>::read(source)?; diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index 6e08395..a99e207 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -7,13 +7,13 @@ mod legacy; /// **DEPRECATED**. /// This is a legacy proc-macro that is used to generate a BufferStream. /// It provides an easy way to implement the `Streamable` trait. -/// > ⚠️ This proc-macro has been deprecated since `0.3.0` in favor of `binary_utils::interfaces::Reader` and `binary_utils::interfaces::Writer` and will be removed in `0.4.0`. +/// > ⚠️ This proc-macro has been deprecated since `0.3.0` in favor of `binary_util::interfaces::Reader` and `binary_util::interfaces::Writer` and will be removed in `0.4.0`. /// /// This proc-macro automatically implements the `Streamable` trait for the struct or enum it is applied to. /// /// Example: /// ```ignore -/// use binary_utils::BinaryStream; +/// use binary_util::BinaryStream; /// /// #[derive(BinaryStream)] /// struct Test { @@ -29,7 +29,7 @@ mod legacy; /// /// Please note that this proc-macro does not support unit structs or named enum variants, meaning a code sample like the following will not work: /// ```warn -/// use binary_utils::BinaryStream; +/// use binary_util::BinaryStream; /// /// // Error: Unit structs are not supported. /// #[derive(BinaryStream)] @@ -53,7 +53,7 @@ pub fn derive_stream(input: TokenStream) -> TokenStream { .into() } -/// This proc-macro implements both the `Reader` and `Writer` traits from `binary_utils::interfaces`. +/// This proc-macro implements both the `Reader` and `Writer` traits from `binary_util::interfaces`. /// It is important to note that not all attributes can be used on all types, and some attributes are exclusive to certain variants. /// /// ## Structs @@ -65,8 +65,8 @@ pub fn derive_stream(input: TokenStream) -> TokenStream { /// The following example will provide both a `Reader` and `Writer` implementation for the struct `ABC`, where each field is encoded as it's respective /// type to the `Bytewriter`/`Bytereader`. /// ```ignore -/// use binary_utils::interfaces::{Reader, Writer}; -/// use binary_utils::BinaryIo; +/// use binary_util::interfaces::{Reader, Writer}; +/// use binary_util::BinaryIo; /// /// #[derive(BinaryIo, Debug)] /// struct ABC { @@ -79,8 +79,8 @@ pub fn derive_stream(input: TokenStream) -> TokenStream { /// Sometimes it can be more optimal to use Unnamed fields, if you do not care about the field names, and only want to encode/decode the fields in the order they are defined. /// The behavior of this macro is the same as the previous example, except the fields are unnamed. /// ```ignore -/// use binary_utils::interfaces::{Reader, Writer}; -/// use binary_utils::BinaryIo; +/// use binary_util::interfaces::{Reader, Writer}; +/// use binary_util::BinaryIo; /// /// #[derive(BinaryIo, Debug)] /// struct ABC(u8, Option, u8); @@ -99,8 +99,8 @@ pub fn derive_stream(input: TokenStream) -> TokenStream { /// The following example will encode the `ProtcolEnum` enum as a `u8`, where each variant is encoded, by default, starting from 0. /// /// ```ignore -/// use binary_utils::BinaryIo; -/// use binary_utils::{Reader, Writer}; +/// use binary_util::BinaryIo; +/// use binary_util::{Reader, Writer}; /// /// #[derive(BinaryIo, Debug)] /// #[repr(u8)] @@ -120,8 +120,8 @@ pub fn derive_stream(input: TokenStream) -> TokenStream { /// The following example makes use of Unnamed variants, in this case `A` to encode both `B` and `C` retrospectively. /// Where `A::JustC` will be encoded as `0x02` with the binary data of struct `B`. /// ```ignore -/// use binary_utils::BinaryIo; -/// use binary_utils::{Reader, Writer}; +/// use binary_util::BinaryIo; +/// use binary_util::{Reader, Writer}; /// /// #[derive(BinaryIo, Debug)] /// pub struct B { @@ -172,8 +172,8 @@ pub fn derive_stream(input: TokenStream) -> TokenStream { /// /// **Example:** /// ```ignore -/// use binary_utils::interfaces::{Reader, Writer}; -/// use binary_utils::BinaryIo; +/// use binary_util::interfaces::{Reader, Writer}; +/// use binary_util::BinaryIo; /// /// #[derive(BinaryIo, Debug)] /// struct ABC { @@ -201,8 +201,8 @@ pub fn derive_stream(input: TokenStream) -> TokenStream { /// **Example:** /// In the following example, `b` is explicitly required to be present when encoding, or decoding `ABC`, and it's value is not allowed to be `None`. /// ```ignore -/// use binary_utils::interfaces::{Reader, Writer}; -/// use binary_utils::BinaryIo; +/// use binary_util::interfaces::{Reader, Writer}; +/// use binary_util::BinaryIo; /// /// #[derive(BinaryIo, Debug)] /// struct ABC { diff --git a/src/interfaces.rs b/src/interfaces.rs index 786a2aa..9c5dd0b 100644 --- a/src/interfaces.rs +++ b/src/interfaces.rs @@ -39,7 +39,7 @@ macro_rules! impl_streamable { /// Allows you to read from a `ByteReader` without needing to know the type. /// /// ```ignore -/// use binary_utils::io::{ByteReader, Reader}; +/// use binary_util::io::{ByteReader, Reader}; /// /// pub struct MyStruct { /// pub a: u8, @@ -186,7 +186,7 @@ impl Reader for SocketAddr { /// Allows you to write to a `ByteWriter` without needing to know the type. /// /// ```ignore -/// use binary_utils::io::{ByteWriter, Writer}; +/// use binary_util::io::{ByteWriter, Writer}; /// /// pub struct MyStruct { /// pub a: u8, @@ -324,8 +324,8 @@ impl Writer for SocketAddr { /// /// ### New Implementation Example /// ```ignore -/// use binary_utils::io::{ByteReader, ByteWriter}; -/// use binary_utils::interfaces::{Reader, Writer}; +/// use binary_util::io::{ByteReader, ByteWriter}; +/// use binary_util::interfaces::{Reader, Writer}; /// /// pub struct MyStruct; /// @@ -337,7 +337,7 @@ impl Writer for SocketAddr { /// A trait to parse and unparse header structs from a given buffer. /// /// ```ignore -/// use binary_utils::{Streamable, error::BinaryError}; +/// use binary_util::{Streamable, error::BinaryError}; /// /// struct Foo { /// bar: u8, diff --git a/src/io.rs b/src/io.rs index b20bee0..d48c387 100644 --- a/src/io.rs +++ b/src/io.rs @@ -53,7 +53,7 @@ macro_rules! write_fn { /// /// ## Example /// ```rust -/// use binary_utils::io::ByteReader; +/// use binary_util::io::ByteReader; /// /// fn main() { /// let mut buf = ByteReader::from(&[0, 253, 255, 255, 255, 15][..]); @@ -70,7 +70,7 @@ macro_rules! write_fn { /// increment the read position of the stream, but rather copies the byte at the /// specified position. /// ```rust -/// use binary_utils::io::ByteReader; +/// use binary_util::io::ByteReader; /// /// fn main() { /// let mut buf = ByteReader::from(&[253, 255, 14, 255, 255, 15][..]); @@ -87,7 +87,7 @@ macro_rules! write_fn { /// This is useful if you are trying to read a struct or optional type and validate the type before /// reading the rest of the struct. /// ```rust -/// use binary_utils::io::ByteReader; +/// use binary_util::io::ByteReader; /// /// struct PingPacket { /// pub id: u8, @@ -173,7 +173,7 @@ impl ByteReader { /// increment the read position of the stream, but rather copies the byte at the /// specified position. /// ```rust - /// use binary_utils::io::ByteReader; + /// use binary_util::io::ByteReader; /// /// fn main() { /// let mut buf = ByteReader::from(&[253, 255, 14, 255, 255, 15][..]); @@ -426,8 +426,8 @@ impl ByteReader { /// /// # Example /// ```rust - /// use binary_utils::io::ByteReader; - /// use binary_utils::interfaces::Reader; + /// use binary_util::io::ByteReader; + /// use binary_util::interfaces::Reader; /// /// pub struct HelloWorld { /// pub magic: u32 @@ -492,8 +492,8 @@ impl ByteReader { /// ## Example /// A generic example of how to use the `ByteWriter` struct. /// ```rust -/// use binary_utils::io::ByteWriter; -/// use binary_utils::io::ByteReader; +/// use binary_util::io::ByteWriter; +/// use binary_util::io::ByteReader; /// /// fn main() { /// let mut writer = ByteWriter::new(); @@ -507,8 +507,8 @@ impl ByteReader { /// /// `ByteWriter` also implements the `Into` trait to convert the `ByteWriter` into a `BytesMut` or `Bytes` structs. /// ```rust -/// use binary_utils::io::ByteWriter; -/// use binary_utils::io::ByteReader; +/// use binary_util::io::ByteWriter; +/// use binary_util::io::ByteReader; /// /// fn main() { /// let mut writer = ByteWriter::new(); @@ -749,8 +749,8 @@ impl ByteWriter { /// /// ## Example /// ```rust - /// use binary_utils::io::ByteWriter; - /// use binary_utils::interfaces::Writer; + /// use binary_util::io::ByteWriter; + /// use binary_util::interfaces::Writer; /// /// pub struct HelloWorld { /// pub magic: u32 diff --git a/src/lib.rs b/src/lib.rs index 78198f5..67763a3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,7 +3,7 @@ /// /// ## Example /// ```no_run -/// use binary_utils::io::ByteReader; +/// use binary_util::io::ByteReader; /// /// const VARINT: &[u8] = &[255, 255, 255, 255, 7]; // 2147483647 /// fn main() { @@ -12,14 +12,14 @@ /// } /// ``` pub mod interfaces; -/// Provides a derive macro that implements `::binary_utils::interfaces::Reader` and `::binary_utils::interfaces::Writer`. +/// Provides a derive macro that implements `::binary_util::interfaces::Reader` and `::binary_util::interfaces::Writer`. /// pub use codegen::*; /// The io module contains implementations of these traits for `bytes::Buf` and `bytes::BufMut`. /// /// Example: /// ```no_run -/// use binary_utils::io::ByteReader; +/// use binary_util::io::ByteReader; /// use bytes::{Buf, BufMut, BytesMut, Bytes}; /// /// fn main() { diff --git a/tests/binary_io_enum.rs b/tests/binary_io_enum.rs index 1303b0a..356f907 100644 --- a/tests/binary_io_enum.rs +++ b/tests/binary_io_enum.rs @@ -1,6 +1,6 @@ -use binary_utils::interfaces::{Reader, Writer}; -use binary_utils::io::ByteReader; -use binary_utils::BinaryIo; +use binary_util::interfaces::{Reader, Writer}; +use binary_util::io::ByteReader; +use binary_util::BinaryIo; #[derive(BinaryIo, Debug)] #[repr(u8)] diff --git a/tests/binary_io_struct.rs b/tests/binary_io_struct.rs index 292b0b4..82fd907 100644 --- a/tests/binary_io_struct.rs +++ b/tests/binary_io_struct.rs @@ -1,6 +1,6 @@ -use binary_utils::interfaces::{Reader, Writer}; -use binary_utils::io::ByteReader; -use binary_utils::BinaryIo; +use binary_util::interfaces::{Reader, Writer}; +use binary_util::io::ByteReader; +use binary_util::BinaryIo; #[derive(BinaryIo, Debug)] struct ABC { diff --git a/tests/reader.rs b/tests/reader.rs index 32c7dbf..dc624f0 100644 --- a/tests/reader.rs +++ b/tests/reader.rs @@ -1,4 +1,4 @@ -use binary_utils::io::ByteReader; +use binary_util::io::ByteReader; // A slice of bytes that is used to test the reader. // this specific slice is encoded as the following: diff --git a/tests/streamable_enums.rs b/tests/streamable_enums.rs index 5f489d1..d272f22 100644 --- a/tests/streamable_enums.rs +++ b/tests/streamable_enums.rs @@ -1,4 +1,4 @@ -use binary_utils::{error::BinaryError, BinaryStream, Streamable}; +use binary_util::{error::BinaryError, BinaryStream, Streamable}; #[derive(Debug, BinaryStream, PartialEq)] #[repr(u8)] diff --git a/tests/streamable_structs.rs b/tests/streamable_structs.rs index 76b8659..29c5caa 100644 --- a/tests/streamable_structs.rs +++ b/tests/streamable_structs.rs @@ -1,4 +1,4 @@ -use binary_utils::{BinaryStream, Streamable}; +use binary_util::{BinaryStream, Streamable}; #[derive(Debug, BinaryStream)] pub struct TestPacket { diff --git a/tests/varint.rs b/tests/varint.rs index 74feee7..72a89e0 100644 --- a/tests/varint.rs +++ b/tests/varint.rs @@ -1,4 +1,4 @@ -use binary_utils::io::{ByteReader, ByteWriter}; +use binary_util::io::{ByteReader, ByteWriter}; pub const FIVE_BYTE_VARINT: &[u8] = &[255, 255, 255, 255, 7]; // 2147483647 pub const THREE_BYTE_VARINT: &[u8] = &[255, 255, 127]; // 2097151