Closed eyeplum closed 6 years ago
Thanks for the review!
I will update according to the comments and add some tests, also will put off NR1
for now.
I already have some rough ideas about how NR1
could be implemented, so hopefully a new PR about that will come soon :)
Thanks again.
Thanks for the review @behnam!
I have addressed all the comments and rebased to the latest master
.
I have also run cargo fmt
and committed the changes.
Although I'm not able to get cargo clippy
to work - tried to install with cargo +nightly install clippy
, got compile errors :(
Thanks @behnam for the advice. A macro indeed makes the tests look better and easier to change. I have also squashed a few commits.
(delegate means you have permission to bors: r+
it now, when you're ready, if I spell it right)
bors: delegate+
:v: eyeplum can now approve this pull request
@CAD97 sure, I will explore and see.
One other thing I'm thinking about is: since len()
fmt()
and cmp()
are all dependent on the string value of self
, is it also possible to simply create a string_value()
method and call it from those methods? Not sure about the memory footprint though.
I notice the initial implementation was going this way but 1a50398 changed it.
The trick is to avoid creating the String
if unnecessary. Because Display
gives ToString
for free, the use-site can create a String
that way if they want it.
Also note that this crate is #[no_std]
. We want to keep these libraries available to no-std environments as much as possible.
Ah, make sense. Thanks!
@CAD97 Tried with enum Name { NR1, NR2, NR3 }
, it does simplify things a lot! So let's do it this way!
Thanks for the advice!
bors: r+
This is a work in progress for implementing Unicode Name - NR2 (#171).
Feedback is welcome!