Skip to content

Commit

Permalink
remove references
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph rance committed Sep 19, 2023
1 parent 9f2dd9f commit 7d4f128
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
13 changes: 0 additions & 13 deletions parquet_derive/src/parquet_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,19 +443,6 @@ impl Field {
quote! { ::uuid::Uuid::parse_str(vals[i].data().convert()).unwrap() }
}
_ => match &self.ty {
Type::Reference(_, ref first_type) => match **first_type {
Type::TypePath(_) => match self.ty.last_part().as_str() {
"String" => quote! {
std::rc::Rc<String>::new(String::from(std::str::from_utf8(vals[i].data()).expect("invalid UTF-8 sequence")))
},
"str" => quote! {
std::rc::Rc<str>::new(*std::str::from_utf8(vals[i].data()).expect("invalid UTF-8 sequence"))
},
f => unimplemented!("Unsupported: {:#?}", f),
},
Type::Slice(_) => quote! { std::rc::Rc<str>::new(*vals[i].data()) },
ref f => unimplemented!("Unsupported: {:#?}", f),
},
Type::TypePath(_) => match self.ty.last_part().as_str() {
"String" => quote! { String::from(std::str::from_utf8(vals[i].data())
.expect("invalid UTF-8 sequence")) },
Expand Down
9 changes: 0 additions & 9 deletions parquet_derive_test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ struct ACompleteRecord<'a> {
#[derive(PartialEq, ParquetRecordWriter, ParquetRecordReader, Debug)]
struct APartiallyCompleteRecord {
pub bool: bool,
//pub str_reference: &'a str,
pub string: String,
//pub string_reference: &'a String,
pub i16: i16,
pub i32: i32,
pub u64: u64,
Expand All @@ -64,7 +62,6 @@ struct APartiallyCompleteRecord {
pub now: chrono::NaiveDateTime,
pub date: chrono::NaiveDate,
pub byte_vec: Vec<u8>,
//pub byte_slice: &'a [u8],
}

#[cfg(test)]
Expand Down Expand Up @@ -173,9 +170,7 @@ mod tests {

let mut drs: Vec<APartiallyCompleteRecord> = vec![APartiallyCompleteRecord {
bool: true,
//str_reference: "a str",
string: "a string".into(),
//string_reference: &"a string reference".into(),
i16: -45,
i32: 456,
u64: 4563424,
Expand All @@ -185,14 +180,11 @@ mod tests {
now: chrono::Utc::now().naive_local(),
date: chrono::naive::NaiveDate::from_ymd_opt(2015, 3, 14).unwrap(),
byte_vec: vec![0x65, 0x66, 0x67],
//byte_slice: &vec![0x65, 0x66, 0x67][..],
}];

let mut out: Vec<APartiallyCompleteRecord> = vec![APartiallyCompleteRecord {
bool: false,
//str_reference: "a different str",
string: "a different string".into(),
//string_reference: &"a different string reference".into(),
i16: -450,
i32: 4560,
u64: 45634240,
Expand All @@ -202,7 +194,6 @@ mod tests {
now: chrono::Utc::now().naive_local(),
date: chrono::naive::NaiveDate::from_ymd_opt(1982, 1, 27).unwrap(),
byte_vec: vec![0x17, 0x18, 0x19],
//byte_slice: &vec![0x17, 0x18, 0x19][..],
}];

use parquet::file::{
Expand Down

0 comments on commit 7d4f128

Please sign in to comment.