Closed virtualritz closed 8 months ago
Thanks for the suggestion @virtualritz :+1: This has come up before and although those names are more idiomatic with modern Rust (and if I were writing them today I would definitely use to_
rather than get_
), we opted not to churn them because they've already been in that form for years.
I understand. Hence my suggestion with keeping the old names and adding deprecation warnings.
It's one of the perks of Rust that the language supports this natively. :]
Suffice to say I'd make a PR with those changes – if it had any chance of being accepted.
At some point I think we’ll probably release a semver compatible 2.0 that cleans up our module layout and feautes a bit. I think that would also be a good time to do this deprecation. In a major release you’d typically just make breaking changes, but for uuid
I’m trying to maintain strict backwards compatibility so you can feel confident using Uuid
in public APIs.
We don't have anything actionable here in the near future so I'll go ahead and close this one to keep our issue list current, but is something worth revisiting if we do come around to a 2.0
See "Getter names follow Rust convention (C-GETTER)".
Suggestion:
get_
prefix.#[deprecated()]
and#[inline(always)]
and have them plain call the stripped ones.to_
prefix instead.Specifically:
Uuid::get_timestamp()
Uuid::get_variant()
Uuid::get_version()
Uuid::get_version_num()