amazon-ion / ion-schema-rust

Rust implementation of Ion Schema
https://amazon-ion.github.io/ion-schema/sandbox
Apache License 2.0
13 stars 6 forks source link

adds changes for `utf8_byte_length` constraint #130

Closed desaikd closed 1 year ago

desaikd commented 1 year ago

Issue #9 #10

Description of changes: This PR works on adding implementation of utf8_byte_length constraint.

Grammar:

utf8_byte_length: <INT>
utf8_byte_length: <RANGE<INT>>

Ion Schema specification: https://amzn.github.io/ion-schema/docs/isl-1-0/spec#utf8_byte_length

List of changes:

Tests: added unit tests for utf8_byte_length implementation.

desaikd commented 1 year ago

I think clippy was suggesting that you replace foo != None with foo.is_some() rather than Option::is_some(&foo). I don't think it makes much difference though.

Yes, I have already changed according to clippy warnings in https://github.com/amzn/ion-schema-rust/pull/130/commits/02285169a1c986f3acbf0198b4dec90f4667ae4b so it seems to be good now.