It makes me wonder if there was some LLM help, based on how similar the fn structure and identifier names are.
I would bet there was
With an entire section complaining how many lines of code existing implementations are, looks like they did found a good simple implementation to clone in Rust then deliberately not mention it.