shamblett / coap

A Coap package for dart
Other
16 stars 13 forks source link

refactor!: clean up `CoapMessage` class #88

Closed JKRhb closed 2 years ago

JKRhb commented 2 years ago

I noticed some more clean up potential in the CoapMessage class, due to the fact that you do not need to return the current object for chaining method calls because of Dart's cascade notation. I also managed to get rid of a couple of null check operators, making the package a bit more reliable.

Technically, this PR introduces small but breaking API changes, so I guess it should be deferred to a point when more critical API changes have accumulated for a new major release.

CC @JosefWN

Depends on #89.

JosefWN commented 2 years ago

Yeah I actually thought about doing the same thing, good thinking 👍

Chaining isn't that critical in Dart anyway since you can chain either way with ... LGTM.

JKRhb commented 2 years ago

I now rebased this PR against #89, so that the two PRs can be merged one after another.