I think the documentation of https://doc.rust-lang.org/std/collections/btree_map/struct.CursorMut.html#method.insert_after is not quite right.
First, it says the function panics when given a bad key, but it has a Result with an Err type of UnorderedKeyError, which is presumably returned when the key is bad.
Second, where it says "current element " I think it should say "previous element". There is no "current element" for a Cursor, the Cursor points in-between two elements ( well... usually, unless the Cursor is at the start or end of the map ).
The same applies to insert_before.