Skip to content

module ordered is private #33

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

Closed
kimhyunkang opened this issue Dec 30, 2015 · 2 comments
Closed

module ordered is private #33

kimhyunkang opened this issue Dec 30, 2015 · 2 comments

Comments

@kimhyunkang
Copy link

Is there a specific reason ordered module is private?

This makes convenient macros such as try! unusable.

For example:

use bson::Document;

fn set_and_get_age() -> Result<i32, MyCustomError> {
  let mut doc = Document::new();
  doc.insert("age".to_string(), 32 as i32);

  let value = try!(doc.get_i32("age"));
  Ok(value)
}

This code does not compile because MyCustomError does not implement From<bson::ordered::ValueAccessError>. You can't provide a custom impl for From, because the module is private.

@zonyitoo
Copy link
Contributor

Because the ordered is just a temporary solution for implementing ordered map. I am still waiting for the linked-hash-map to be stablized.

@zonyitoo
Copy link
Contributor

zonyitoo commented Mar 5, 2016

Merge with #35 .

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