Remove Record::from_raw_cols_vals_unchecked (#11810)

# Description
Follows from #11718 and replaces all usages of
`Record::from_raw_cols_vals_unchecked` with iterator or `record!`
equivalents.
This commit is contained in:
Ian Manske
2024-02-18 12:20:22 +00:00
committed by GitHub
parent 28f0f32ae7
commit fb4251aba7
18 changed files with 267 additions and 359 deletions

View File

@ -1,7 +1,7 @@
use std::{io::Write, path::PathBuf};
use chrono::{DateTime, FixedOffset, NaiveDateTime, Offset};
use nu_protocol::{ast::PathMember, Record, Span, Value};
use nu_protocol::{ast::PathMember, record, Span, Value};
use nu_test_support::{
fs::{line_ending, Stub},
nu, pipeline,
@ -234,22 +234,16 @@ impl TestRow {
impl From<TestRow> for Value {
fn from(row: TestRow) -> Self {
Value::record(
Record::from_iter(vec![
("somebool".into(), Value::bool(row.0, Span::unknown())),
("someint".into(), Value::int(row.1, Span::unknown())),
("somefloat".into(), Value::float(row.2, Span::unknown())),
(
"somefilesize".into(),
Value::filesize(row.3, Span::unknown()),
),
(
"someduration".into(),
Value::duration(row.4, Span::unknown()),
),
("somedate".into(), Value::date(row.5, Span::unknown())),
("somestring".into(), Value::string(row.6, Span::unknown())),
("somebinary".into(), Value::binary(row.7, Span::unknown())),
]),
record! {
"somebool" => Value::bool(row.0, Span::unknown()),
"someint" => Value::int(row.1, Span::unknown()),
"somefloat" => Value::float(row.2, Span::unknown()),
"somefilesize" => Value::filesize(row.3, Span::unknown()),
"someduration" => Value::duration(row.4, Span::unknown()),
"somedate" => Value::date(row.5, Span::unknown()),
"somestring" => Value::string(row.6, Span::unknown()),
"somebinary" => Value::binary(row.7, Span::unknown()),
},
Span::unknown(),
)
}