Why Nostr? What is Njump?
2023-08-08 07:42:00
in reply to

Mo :ferris: :tux: on Nostr: npub1ha2lr…mk5hs Great post :ablobcatheart: Personally, I prefer early return and ...

Great post :ablobcatheart:

Personally, I prefer early return and think that it is widely used in Rust. This would change Name::new such that you `return` the error and at the end you have `Ok(…)` without the `else`.

Also, the Rust community expects `new` to return Self directly. Clippy used to suggest renaming `new` to `build` when returning a Result or Option of Self.

User::new is not doing anything. I would remove it and just use struct initialization instead.
Author Public Key
npub1j7fc87rk03whjh72mphc9hrm8zecfsdywdcscsesznwzcrasudvs75mapy