Skip to content

Commit

Permalink
Do not implement both Borrow<str> and Borrow<[u8]>.
Browse files Browse the repository at this point in the history
  • Loading branch information
timothee-haudebourg committed Feb 27, 2024
1 parent 24d2ae0 commit 821b6ee
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "static-regular-grammar"
version = "1.1.1"
version = "1.1.2"
edition = "2021"
authors = ["Timothée Haudebourg <[email protected]>"]
categories = ["parsing"]
Expand Down
12 changes: 0 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,6 @@ fn generate_typed<T: Token>(

let borrow_bytes = T::rust_inner_as_bytes_method().map(|as_bytes| {
quote! {
impl ::core::borrow::Borrow<[u8]> for #ident {
fn borrow(&self) -> &[u8] {
self.0.#as_bytes()
}
}

impl ::core::convert::AsRef<[u8]> for #ident {
fn as_ref(&self) -> &[u8] {
self.0.#as_bytes()
Expand Down Expand Up @@ -549,12 +543,6 @@ fn generate_typed<T: Token>(
}
}

impl ::core::borrow::Borrow<str> for #ident {
fn borrow(&self) -> &str {
#as_ascii
}
}

impl ::core::convert::AsRef<str> for #ident {
fn as_ref(&self) -> &str {
#as_ascii
Expand Down

0 comments on commit 821b6ee

Please sign in to comment.