project-utils icon indicating copy to clipboard operation
project-utils copied to clipboard

`Generator::lib_name` and `with_lib_name` should take `AsRef<str>` instead of `AsRef<String>`

Open ghost opened this issue 5 years ago • 4 comments

Neither String or &String actually implement AsRef<String>. To work around that using standard types I had to wrap the string with a smart pointer: .lib_name(Box::new("mylibrary".to_string())).

ghost avatar Nov 03 '20 12:11 ghost

Oh that's an oversight, thanks for reporting! :+1: I'll change it right away!

karroffel avatar Nov 03 '20 19:11 karroffel

The type seems to be AsRef<str> which both String, &String and &str should implement, no?

https://github.com/godot-rust/project-utils/blob/dd8aaa1ce54f3e36aa5fec0b9b05851ac62d99f4/src/generate.rs#L71-L82

karroffel avatar Nov 03 '20 19:11 karroffel

It seems like that's an issue on the latest crates.io version but the git version should work!

karroffel avatar Nov 03 '20 19:11 karroffel

Yes, I was using the crates version. I'll switch to the git version for now. Sorry for not checking it first.

ghost avatar Nov 04 '20 04:11 ghost