lumeohq / xsd-parser-rs

A xsd/wsdl => rust code generator written in rust
Apache License 2.0
100 stars 39 forks source link

Replace `.len() < 1` with `.is_empty()` in generated code #120

Closed DmitrySamoylov closed 1 year ago

jplatte commented 3 years ago

Since this was sitting in my notifications for forever, I just had a look. Seems like this is just a specific case of 1 for an otherwise generic check, and as such I don't think we should change the codegen. We can probably just add an #[allow] to that section of the code.

DmitrySamoylov commented 3 years ago

Agreed, #[allow] would be better. But I don't get how we cannot change codegen. #[allow] should be added by codegen?

jplatte commented 3 years ago

Right, I just meant not complicate it with extra branches.

wt commented 1 year ago

I think the is_empty would be better for the case with < 1. Isn't is possible that that method could be implemented in a more efficient manner than the .len() method?

WhyNotHugo commented 1 year ago

See: https://github.com/lumeohq/xsd-parser-rs/pull/148