-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
A-completionautocompletionautocompletionE-has-instructionsIssue has some instructions and pointers to code to get startedIssue has some instructions and pointers to code to get startedS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now
Description
The following code depends on bson = {version = "1.1", features = ["decimal128"]}.
#[cfg(feature = "decimal128")]
use bson::decimal128::Decimal128;
use bson::{
doc,
Bson,
};
fn demonstrator() -> Vec<u8> {
let js = Bson::JavaScriptCodeWithScope(JavaScriptCodeWithScope {
code: String::from("console.log('a bug?', x);"),
scope: doc! {"x": 42},
});
let doc = doc!{ "js": js };
let mut out = Vec::new();
doc.to_writer(&mut out);
out
}The identifier "JavaScriptCodeWithScope" can be used as bson::JavaScriptCodeWithScope, but when I do ctrl-., and opt to perform the import, it places the import within the feature-gated import block. In theory that could be the correct action, and I'm not sure how smart RA could be about this, but I think importing into the non-cfg-gated block is a better choice in the absence of a specific reason to choose one or the other.
Metadata
Metadata
Assignees
Labels
A-completionautocompletionautocompletionE-has-instructionsIssue has some instructions and pointers to code to get startedIssue has some instructions and pointers to code to get startedS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now