forked from extern/nushell
Merge pull request #572 from nushell/bigint
Migrated numerics to BigInt/BigDecimal
This commit is contained in:
commit
9773f8fbab
@ -186,13 +186,14 @@ impl std::io::Read for BytesReader {
|
|||||||
pub fn from_bson_bytes_to_value(
|
pub fn from_bson_bytes_to_value(
|
||||||
bytes: Vec<u8>,
|
bytes: Vec<u8>,
|
||||||
tag: impl Into<Tag>,
|
tag: impl Into<Tag>,
|
||||||
) -> bson::DecoderResult<Tagged<Value>> {
|
) -> Result<Tagged<Value>, ShellError> {
|
||||||
let mut docs = Vec::new();
|
let mut docs = Vec::new();
|
||||||
let mut b_reader = BytesReader::new(bytes);
|
let mut b_reader = BytesReader::new(bytes);
|
||||||
while let Ok(v) = decode_document(&mut b_reader) {
|
while let Ok(v) = decode_document(&mut b_reader) {
|
||||||
docs.push(Bson::Document(v));
|
docs.push(Bson::Document(v));
|
||||||
}
|
}
|
||||||
Ok(convert_bson_value_to_nu_value(&Bson::Array(docs), tag).expect("FIXME: Don't commit like this"))
|
|
||||||
|
convert_bson_value_to_nu_value(&Bson::Array(docs), tag)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn from_bson(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStream, ShellError> {
|
fn from_bson(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStream, ShellError> {
|
||||||
|
Loading…
Reference in New Issue
Block a user