diff --git a/crates/nu-protocol/src/value/mod.rs b/crates/nu-protocol/src/value/mod.rs index 463777d48c..521ce0b29b 100644 --- a/crates/nu-protocol/src/value/mod.rs +++ b/crates/nu-protocol/src/value/mod.rs @@ -1,12 +1,10 @@ mod range; -mod row; mod stream; mod unit; use chrono::{DateTime, FixedOffset}; use chrono_humanize::HumanTime; pub use range::*; -pub use row::*; use serde::{Deserialize, Serialize}; pub use stream::*; pub use unit::*; diff --git a/crates/nu-protocol/src/value/row.rs b/crates/nu-protocol/src/value/row.rs deleted file mode 100644 index 231f8d8669..0000000000 --- a/crates/nu-protocol/src/value/row.rs +++ /dev/null @@ -1,54 +0,0 @@ -use std::{cell::RefCell, fmt::Debug, rc::Rc}; - -use crate::*; - -#[derive(Clone)] -pub struct RowStream(Rc>>>); - -impl RowStream { - pub fn into_string(self, headers: Vec, config: &Config) -> String { - format!( - "[{}]\n[{}]", - headers - .iter() - .map(|x| x.to_string()) - .collect::>() - .join(", "), - self.map(|x: Vec| { - x.into_iter() - .map(|x| x.into_string(", ", config)) - .collect::>() - .join(", ") - }) - .collect::>() - .join("\n") - ) - } -} - -impl Debug for RowStream { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("ValueStream").finish() - } -} - -impl Iterator for RowStream { - type Item = Vec; - - fn next(&mut self) -> Option { - { - let mut iter = self.0.borrow_mut(); - iter.next() - } - } -} - -pub trait IntoRowStream { - fn into_row_stream(self) -> RowStream; -} - -impl IntoRowStream for Vec> { - fn into_row_stream(self) -> RowStream { - RowStream(Rc::new(RefCell::new(self.into_iter()))) - } -}