Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core::fmt::String missing for error #2

Closed
leshow opened this issue Feb 5, 2015 · 2 comments
Closed

core::fmt::String missing for error #2

leshow opened this issue Feb 5, 2015 · 2 comments

Comments

@leshow
Copy link

leshow commented Feb 5, 2015

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?

@skade
Copy link
Owner

skade commented Feb 5, 2015

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 :(.

@skade
Copy link
Owner

skade commented Feb 27, 2015

Hi, I fixed the example.

@skade skade closed this as completed Feb 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants