aboutsummaryrefslogtreecommitdiff
path: root/src/string_record.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/string_record.rs')
-rw-r--r--src/string_record.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/string_record.rs b/src/string_record.rs
index 4e807f2..4e758f3 100644
--- a/src/string_record.rs
+++ b/src/string_record.rs
@@ -610,6 +610,14 @@ impl StringRecord {
self.0
}
+ /// Clone this record, but only copy `fields` up to the end of bounds. This
+ /// is useful when one wants to copy a record, but not necessarily any
+ /// excess capacity in that record.
+ #[inline]
+ pub(crate) fn clone_truncated(&self) -> StringRecord {
+ StringRecord(self.0.clone_truncated())
+ }
+
/// A safe function for reading CSV data into a `StringRecord`.
///
/// This relies on the internal representation of `StringRecord`.