Yeah, but Cargo.lock is explicitly computer generated*, so it not having a .toml extension is good. It being .toml helps the system recognize it as a TOML file, albeit one with a specific structure** while keeping the computer generated one without a recognizable extension.
*If I recall the documentation say your changes will be overwritten.
** This is par for the course, lots of config file with specific structure are written in .xml, .yaml, .json, etc.