rust-embedded-community / pc-keyboard

PS/2 Keyboard Decoder in Rust
Apache License 2.0
96 stars 28 forks source link

Consistency with name of crate and usage #7

Closed jerryajay closed 2 years ago

jerryajay commented 4 years ago

The name of the crate is : pc-keyboard (notice the dash) While usage, I had to use it as: pc_keyboard (notice the underscore)

It is a issue because when I encountered your crate, i made the dependency entry in my Cargo.toml as pc_keyboard = [ver] just to discover that the Cargo paniced and the right name being pc-keyboard.

thejpster commented 4 years ago

Yeah, this happens when crates contain a dash in the name. A dash isn't valid in a Rust identifier so the compiler requires you to type an underscore in the source code. Cargo is fine with a dash though.

This is the same for cortex-m, cortex-m-rt, etc. It's just one of those things I'm afraid.