kellerkindt / asn1rs

Generates Rust Code and optionally compatible Protobuf schema files from ASN.1 definitions.
http://asn1.rs
Apache License 2.0
54 stars 19 forks source link

trivial: Build Error #65

Closed gabhijit closed 3 years ago

gabhijit commented 3 years ago

When trying to run cargo build following build error is observed.

$ cargo build
   Compiling asn1rs-model v0.2.2 (/home/gabhijit/Work/hyphenOs/asn1rs/asn1rs-model)
error[E0599]: no method named `value` found for struct `LitBool` in the current scope
   --> asn1rs-model/src/ast/attribute.rs:194:78
    |
194 | ...                   syn::Lit::Bool(val) => LiteralValue::Boolean(val.value()),
    |                                                                        ^^^^^-- help: remove the arguments
    |                                                                        |
    |                                                                        field, not a method

error: aborting due to previous error

For more information about this error, try `rustc --explain E0599`.
error: could not compile `asn1rs-model`

To learn more, run the command again with --verbose.

The fix is trivial, will send a PR.

kellerkindt commented 3 years ago

Oh, my fault. the method exist for LitBool, but not before version 1.0.61. It should be fixed by 96df6b2f232f5dc7b3c357c73ffbe0315b972282. Can you verify that?

Thanks for letting me know!

gabhijit commented 3 years ago

Odd. :-) I thought I checked with latest syn. I believe it's perhaps a good idea to make following changes to Cargo.toml so that the latest ones are always picked.

[dev-dependencies]
syn = {version = "1.0", features = ["full", "visit"] }
quote = "1.0"
proc-macro2 = "1.0"

And since this crate itself is 'pre-1.0.0' it should be fine I believe for now.

gabhijit commented 3 years ago

Oh, my fault. the method exist for LitBool, but not before version 1.0.61. It should be fixed by 96df6b2. Can you verify that?

Thanks for letting me know!

Yes this works.