rust-ux / uX

Non standard integer types like `u7`, `u9`, `u10`, `u63`, `i7`, `i9`
Apache License 2.0
119 stars 37 forks source link

feat: provide mask method which returns error #75

Closed dzmitry-lahoda closed 2 months ago

dzmitry-lahoda commented 2 months ago

so can fail deserialzation if there are bits enabled above mask

needed for binary serde, speficifically https://github.com/rust-ux/uX/pull/74

bbaldino commented 2 months ago

Are you running into a need for this in the latest version? After https://github.com/rust-ux/uX/pull/65 was merged, types should always be in a valid state so there shouldn't be any need to explicitly mask them.

dzmitry-lahoda commented 2 months ago

hello, seems yes laters.

but I cannot use https://github.com/rust-ux/uX/blob/ab2f367e6f4503e072db56d1b9e5204563912eaa/src/lib.rs#L118 as panic is not an option in DEserialize. it must error. so will use new logic to produce error

dzmitry-lahoda commented 2 months ago

Oh, I saw TryFrom non implemented in PR, but it is in master. Seems like backlog is not cleaned on GH. Project feels anandoned.

bbaldino commented 2 months ago

@dzmitry-lahoda we're going through a bit of a transition as the original maintainer stepped back a bit, but I've recently been trying to do some work here, hoping to spend more time on it.

dzmitry-lahoda commented 2 months ago

@bbaldino given direct contact opportunity, may you take a look https://github.com/rust-ux/uX/pull/74 ?

so really did that method by enabling try from for all types