mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 06:35:56 +02:00
Make the default int an i64 (#3428)
* Make the default int an i64 * fmt * Fix random integer * Treat pids as i64 for now
This commit is contained in:
@ -41,7 +41,8 @@ pub fn value_to_bson_value(v: &Value) -> Result<Bson, ShellError> {
|
||||
)
|
||||
})?)
|
||||
}
|
||||
UntaggedValue::Primitive(Primitive::Int(i)) => {
|
||||
UntaggedValue::Primitive(Primitive::Int(i)) => Bson::I64(*i),
|
||||
UntaggedValue::Primitive(Primitive::BigInt(i)) => {
|
||||
Bson::I64(i.tagged(&v.tag).coerce_into("converting to BSON")?)
|
||||
}
|
||||
UntaggedValue::Primitive(Primitive::Nothing) => Bson::Null,
|
||||
@ -50,9 +51,7 @@ pub fn value_to_bson_value(v: &Value) -> Result<Bson, ShellError> {
|
||||
path.iter()
|
||||
.map(|x| match &x.unspanned {
|
||||
UnspannedPathMember::String(string) => Ok(Bson::String(string.clone())),
|
||||
UnspannedPathMember::Int(int) => Ok(Bson::I64(
|
||||
int.tagged(&v.tag).coerce_into("converting to BSON")?,
|
||||
)),
|
||||
UnspannedPathMember::Int(int) => Ok(Bson::I64(*int)),
|
||||
})
|
||||
.collect::<Result<Vec<Bson>, ShellError>>()?,
|
||||
),
|
||||
@ -183,7 +182,7 @@ fn get_binary_subtype(tagged_value: &Value) -> Result<BinarySubtype, ShellError>
|
||||
"md5" => BinarySubtype::Md5,
|
||||
_ => unreachable!(),
|
||||
}),
|
||||
UntaggedValue::Primitive(Primitive::Int(i)) => Ok(BinarySubtype::UserDefined(
|
||||
UntaggedValue::Primitive(Primitive::BigInt(i)) => Ok(BinarySubtype::UserDefined(
|
||||
i.tagged(&tagged_value.tag)
|
||||
.coerce_into("converting to BSON binary subtype")?,
|
||||
)),
|
||||
|
Reference in New Issue
Block a user