vickenty / lang-c

Lightweight C parser for Rust
Apache License 2.0
202 stars 30 forks source link

Readme example doesn't compile on 1.30.1 stable #2

Closed itamar8910 closed 5 years ago

itamar8910 commented 5 years ago

When trying to compile the example in the readme: println!("{:?}", parse(&config, "example.c"));

I'm getting the following error: the size for values of type 'str' cannot be known at compilation time

This is resolved when passing a String reference instead of an str: println!("{:?}", parse(&config, &"example.c".to_string()));

vickenty commented 5 years ago

Thanks!