Skip to content

Commit

Permalink
Simplify code, not sure why it was done this way (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex authored May 6, 2023
1 parent 6ffcae6 commit 4713a63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion asn1_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ fn generate_read_element(
if is_defined_by_marker {
let f = syn::Ident::new(f_name, proc_macro2::Span::call_site());
quote::quote! {{
#f = (p.read_element()#add_error_location?, asn1::DefinedByMarker::marker());
#f = p.read_element()#add_error_location?;
asn1::DefinedByMarker::marker()
}}
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ pub const fn explicit_tag(tag: u32) -> Tag {
/// considered a part of the supported API surface.
#[doc(hidden)]
pub fn read_defined_by<'a, T: Asn1Readable<'a>, U: Asn1DefinedByReadable<'a, T>>(
v: (T, DefinedByMarker<T>),
v: T,
p: &mut Parser<'a>,
) -> ParseResult<U> {
U::parse(v.0, p)
U::parse(v, p)
}

/// This API is public so that it may be used from macros, but should not be
Expand Down

0 comments on commit 4713a63

Please sign in to comment.