cooklang / cooklang-rs

Canonical Cooklang parser in Rust
https://cooklang.github.io/cooklang-rs/
MIT License
44 stars 6 forks source link

Improve name url handling #14

Closed Someone0nEarth closed 7 months ago

Someone0nEarth commented 7 months ago

Improves the parsing of the name and URL for metadata key values like author and source.

See: https://github.com/cooklang/cooklang-rs/issues/11#issuecomment-2035737123

As already mentioned, first time rust coding for me.. so maybe my changes are not very rust-idiomatic.. feel free to change or ping me (always like to learn :).

Have fun, someone.earth

Zheoni commented 7 months ago

Looks good, thank you!

As for idiomatic rust, the name_and_url method is a constructor and will usually be called just new, but because it's internal it doesn't matter. 😄

Someone0nEarth commented 7 months ago

Thanks for merging!

@Constructor: yeah.. I was between "new" and this name.. . I found it a little more bit readable.. but "new" would work good enough too.

Have fun, someone.earth