skade / leveldb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

core::fmt::String missing for error

leshow opened this issue · comments

running the example code I'm getting a

the trait `core::fmt::String` is not implemented for the type `leveldb::database::error::Error` [E0277]
src/main.rs:45         Err(e) => { panic!("failed to open database: {}", e) }

I believe error is just missing a #[derive(Display)] in order for it to be printed to the console, am I correct?

Eh, yes :), somewhat. Use "{:?}" as an output marker. That uses fmt::Debug instead, which all the types implement. I do agree that errors should probably implement Display as well, I'll file this as a sep bug.

I cannot fix it this morning.

Probably better run the example in https://github.com/skade/leveldb/blob/master/src/lib.rs and lobby for this change in cargo: rust-lang/cargo#383

The README code is currently not run as tests for that reason :(.

Hi, I fixed the example.