}
}
- pub fn decode(&self, decoder: &Decoder) -> Result<DecodedRecord, Error> {
+ pub fn decode(self, decoder: &Decoder) -> Result<DecodedRecord, Error> {
Ok(match self {
Record::Header(record) => record.decode(decoder),
Record::Variable(record) => record.decode(decoder),
Record::NumberOfCases(record) => DecodedRecord::NumberOfCases(record.clone()),
Record::Text(record) => record.decode(decoder),
Record::OtherExtension(record) => DecodedRecord::OtherExtension(record.clone()),
- Record::EndOfHeaders(record) => DecodedRecord::EndOfHeaders(*record),
+ Record::EndOfHeaders(record) => DecodedRecord::EndOfHeaders(record),
Record::ZHeader(record) => DecodedRecord::ZHeader(record.clone()),
Record::ZTrailer(record) => DecodedRecord::ZTrailer(record.clone()),
Record::Cases(record) => DecodedRecord::Cases(record.clone()),
})
}
- pub fn decode(&self, decoder: &Decoder) -> DecodedRecord {
+ pub fn decode(self, decoder: &Decoder) -> DecodedRecord {
let eye_catcher = decoder.decode(&self.eye_catcher).to_string();
let file_label = decoder.decode(&self.file_label).to_string();
let creation_date = decoder.decode(&self.creation_date).to_string();
Ok(Some(values))
}
- fn decode(&self, decoder: &Decoder) -> Value<String> {
+ fn decode(self, decoder: &Decoder) -> Value<String> {
match self {
- Self::Number(x) => Value::Number(*x),
+ Self::Number(x) => Value::Number(x),
Self::String(s) => Value::String(decoder.decode_exact_length(&s.0).into()),
}
}
}))
}
- pub fn decode(&self, decoder: &Decoder) -> DecodedRecord {
+ pub fn decode(self, decoder: &Decoder) -> DecodedRecord {
DecodedRecord::Variable(VariableRecord {
offsets: self.offsets.clone(),
width: self.width,
})))
}
- fn decode(&self, decoder: &Decoder) -> ValueLabelRecord<RawStr<8>, String> {
+ fn decode(self, decoder: &Decoder) -> ValueLabelRecord<RawStr<8>, String> {
let labels = self
.labels
.iter()
}
}
- pub fn decode(&self, decoder: &Decoder) -> DecodedRecord {
+ pub fn decode(self, decoder: &Decoder) -> DecodedRecord {
DecodedRecord::Document(DocumentRecord {
offsets: self.offsets.clone(),
lines: self
}
impl MultipleResponseRecord<RawString, RawString> {
- fn decode(&self, decoder: &Decoder) -> DecodedRecord {
+ fn decode(self, decoder: &Decoder) -> DecodedRecord {
let mut sets = Vec::new();
for set in self.0.iter() {
if let Some(set) = set.decode(decoder).issue_warning(&decoder.warn) {
}
impl LongStringMissingValueRecord<RawString, RawStr<8>> {
- pub fn decode(&self, decoder: &Decoder) -> LongStringMissingValueRecord<Identifier, String> {
+ pub fn decode(self, decoder: &Decoder) -> LongStringMissingValueRecord<Identifier, String> {
let mut mvs = Vec::with_capacity(self.0.len());
for mv in self.0.iter() {
if let Some(mv) = mv
text: extension.data.into(),
}
}
- pub fn decode(&self, decoder: &Decoder) -> DecodedRecord {
+ pub fn decode(self, decoder: &Decoder) -> DecodedRecord {
match self.rec_type {
TextRecordType::VariableSets => {
- DecodedRecord::VariableSets(VariableSetRecord::decode(self, decoder))
+ DecodedRecord::VariableSets(VariableSetRecord::decode(&self, decoder))
}
TextRecordType::ProductInfo => {
- DecodedRecord::ProductInfo(ProductInfoRecord::decode(self, decoder))
+ DecodedRecord::ProductInfo(ProductInfoRecord::decode(&self, decoder))
}
TextRecordType::LongNames => {
- DecodedRecord::LongNames(LongNamesRecord::decode(self, decoder))
+ DecodedRecord::LongNames(LongNamesRecord::decode(&self, decoder))
}
TextRecordType::VeryLongStrings => {
- DecodedRecord::VeryLongStrings(VeryLongStringsRecord::decode(self, decoder))
+ DecodedRecord::VeryLongStrings(VeryLongStringsRecord::decode(&self, decoder))
}
TextRecordType::FileAttributes => {
- DecodedRecord::FileAttributes(FileAttributeRecord::decode(self, decoder))
+ DecodedRecord::FileAttributes(FileAttributeRecord::decode(&self, decoder))
}
TextRecordType::VariableAttributes => {
- DecodedRecord::VariableAttributes(VariableAttributeRecord::decode(self, decoder))
+ DecodedRecord::VariableAttributes(VariableAttributeRecord::decode(&self, decoder))
}
}
}
}
impl LongStringValueLabelRecord<RawString, RawString> {
- fn decode(&self, decoder: &Decoder) -> LongStringValueLabelRecord<Identifier, String> {
+ fn decode(self, decoder: &Decoder) -> LongStringValueLabelRecord<Identifier, String> {
let mut labels = Vec::with_capacity(self.0.len());
for label in &self.0 {
match label.decode(decoder) {