diff --git a/filtergen/src/lib.rs b/filtergen/src/lib.rs index 63137729..a74d9efa 100644 --- a/filtergen/src/lib.rs +++ b/filtergen/src/lib.rs @@ -138,7 +138,7 @@ //! | Integer | `443` | //! | String | `'Safari'` | //! | Integer range | `1024..5000` | -//! | Byte | `|32 2E 30|` | +//! | Byte | `\|32 2E 30\|` | //! //! ## Binary comparison operators //! | Operator | Alias | Description | Example | diff --git a/filtergen/src/utils.rs b/filtergen/src/utils.rs index 47589dd7..73775b3c 100644 --- a/filtergen/src/utils.rs +++ b/filtergen/src/utils.rs @@ -195,7 +195,7 @@ pub(crate) fn binary_to_tokens( BinOp::Eq => { let bytes_lit = syn::LitByteStr::new(b, Span::call_site()); quote! { - #proto.#field().as_bytes() == #bytes_lit + #proto.#field().as_ref() as &[u8] == #bytes_lit } } BinOp::Ne => {