diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-03 03:04:32 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-03 03:04:32 +0000 |
commit | baee69e884d9a35d7ba3af294a96d45c8ae5d037 (patch) | |
tree | b896b61a088e21510b50d6937f858254dc4beff5 | |
parent | 934e598c9f1ee564c2452a4f1f0c64b43fbd1c18 (diff) | |
parent | 6b1e96e1af193743ad4bad031785e2d1d963450c (diff) | |
download | csv-baee69e884d9a35d7ba3af294a96d45c8ae5d037.tar.gz |
Snap for 7256110 from 6b1e96e1af193743ad4bad031785e2d1d963450c to sc-releaseandroid-vts-12.0_r9android-vts-12.0_r8android-vts-12.0_r7android-vts-12.0_r6android-vts-12.0_r5android-vts-12.0_r4android-vts-12.0_r3android-vts-12.0_r2android-vts-12.0_r12android-vts-12.0_r11android-vts-12.0_r10android-vts-12.0_r1android-security-12.0.0_r60android-security-12.0.0_r59android-security-12.0.0_r58android-security-12.0.0_r57android-security-12.0.0_r56android-security-12.0.0_r55android-security-12.0.0_r54android-security-12.0.0_r53android-security-12.0.0_r52android-security-12.0.0_r51android-security-12.0.0_r50android-security-12.0.0_r49android-security-12.0.0_r48android-security-12.0.0_r47android-security-12.0.0_r46android-security-12.0.0_r45android-security-12.0.0_r44android-security-12.0.0_r43android-security-12.0.0_r42android-security-12.0.0_r41android-security-12.0.0_r40android-security-12.0.0_r39android-security-12.0.0_r38android-security-12.0.0_r37android-security-12.0.0_r36android-security-12.0.0_r35android-security-12.0.0_r34android-security-11.0.0_r71android-platform-12.0.0_r9android-platform-12.0.0_r8android-platform-12.0.0_r7android-platform-12.0.0_r6android-platform-12.0.0_r5android-platform-12.0.0_r4android-platform-12.0.0_r32android-platform-12.0.0_r31android-platform-12.0.0_r30android-platform-12.0.0_r3android-platform-12.0.0_r29android-platform-12.0.0_r28android-platform-12.0.0_r27android-platform-12.0.0_r26android-platform-12.0.0_r25android-platform-12.0.0_r24android-platform-12.0.0_r23android-platform-12.0.0_r22android-platform-12.0.0_r21android-platform-12.0.0_r20android-platform-12.0.0_r2android-platform-12.0.0_r19android-platform-12.0.0_r18android-platform-12.0.0_r17android-platform-12.0.0_r16android-platform-12.0.0_r15android-platform-12.0.0_r14android-platform-12.0.0_r13android-platform-12.0.0_r12android-platform-12.0.0_r11android-platform-12.0.0_r10android-platform-12.0.0_r1android-cts-12.0_r9android-cts-12.0_r8android-cts-12.0_r7android-cts-12.0_r6android-cts-12.0_r5android-cts-12.0_r4android-cts-12.0_r3android-cts-12.0_r2android-cts-12.0_r12android-cts-12.0_r11android-cts-12.0_r10android-cts-12.0_r1android-12.0.0_r9android-12.0.0_r8android-12.0.0_r34android-12.0.0_r33android-12.0.0_r31android-12.0.0_r30android-12.0.0_r3android-12.0.0_r25android-12.0.0_r2android-12.0.0_r11android-12.0.0_r10android-12.0.0_r1android12-tests-releaseandroid12-security-releaseandroid12-s5-releaseandroid12-s4-releaseandroid12-s3-releaseandroid12-s2-releaseandroid12-s1-releaseandroid12-releaseandroid12-platform-releaseandroid12-gsi
Change-Id: I16e4509595504ef43ffd267587ce9045c61498ba
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 10 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | LICENSE-MIT | 21 | ||||
-rw-r--r-- | METADATA | 8 | ||||
-rw-r--r-- | UNLICENSE | 24 | ||||
-rw-r--r-- | src/byte_record.rs | 12 | ||||
-rw-r--r-- | src/reader.rs | 8 | ||||
-rw-r--r-- | src/string_record.rs | 8 | ||||
-rw-r--r-- | src/writer.rs | 4 |
11 files changed, 83 insertions, 18 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 8e89782..3af53d7 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "6e8c0a725606829054daabeec0c3e6e3a37c13f9" + "sha1": "d1fe79738d4948d3167f8f3331d4eed4b67c4a10" } } @@ -54,16 +54,16 @@ rust_library { // dependent_library ["feature_list"] // bstr-0.2.15 "default,lazy_static,regex-automata,serde,serde1,serde1-nostd,std,unicode" -// byteorder-1.4.2 +// byteorder-1.4.3 // csv-core-0.1.10 "default" // itoa-0.4.7 "default,std" // lazy_static-1.4.0 // memchr-2.3.4 "std,use_std" -// proc-macro2-1.0.24 "default,proc-macro" +// proc-macro2-1.0.26 "default,proc-macro" // quote-1.0.9 "default,proc-macro" // regex-automata-0.1.9 // ryu-1.0.5 -// serde-1.0.123 "default,derive,serde_derive,std" -// serde_derive-1.0.123 "default" -// syn-1.0.61 "clone-impls,default,derive,parsing,printing,proc-macro,quote" +// serde-1.0.125 "default,derive,serde_derive,std" +// serde_derive-1.0.125 "default" +// syn-1.0.68 "clone-impls,default,derive,parsing,printing,proc-macro,quote" // unicode-xid-0.2.1 "default" @@ -13,7 +13,7 @@ [package] edition = "2018" name = "csv" -version = "1.1.5" +version = "1.1.6" authors = ["Andrew Gallant <jamslam@gmail.com>"] exclude = ["/.travis.yml", "/appveyor.yml", "/ci/*", "/scripts/*"] description = "Fast CSV parsing with support for serde." diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 6c2eb95..628e8cd 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "csv" -version = "1.1.5" #:version +version = "1.1.6" #:version authors = ["Andrew Gallant <jamslam@gmail.com>"] description = "Fast CSV parsing with support for serde." documentation = "http://burntsushi.net/rustdoc/csv/" diff --git a/LICENSE-MIT b/LICENSE-MIT new file mode 100644 index 0000000..3b0a5dc --- /dev/null +++ b/LICENSE-MIT @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Andrew Gallant + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/csv/csv-1.1.5.crate" + value: "https://static.crates.io/crates/csv/csv-1.1.6.crate" } - version: "1.1.5" + version: "1.1.6" license_type: NOTICE last_upgrade_date { year: 2021 - month: 1 - day: 6 + month: 4 + day: 1 } } diff --git a/UNLICENSE b/UNLICENSE new file mode 100644 index 0000000..68a49da --- /dev/null +++ b/UNLICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to <http://unlicense.org/> diff --git a/src/byte_record.rs b/src/byte_record.rs index 777526e..4ccbb96 100644 --- a/src/byte_record.rs +++ b/src/byte_record.rs @@ -497,6 +497,18 @@ impl ByteRecord { &self.0.fields[..self.0.bounds.end()] } + /// 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) -> ByteRecord { + let mut br = ByteRecord::new(); + br.0.pos = self.0.pos.clone(); + br.0.bounds = self.0.bounds.clone(); + br.0.fields = self.0.fields[..self.0.bounds.end()].to_vec(); + br + } + /// Retrieve the underlying parts of a byte record. #[inline] pub(crate) fn as_parts(&mut self) -> (&mut Vec<u8>, &mut Vec<usize>) { diff --git a/src/reader.rs b/src/reader.rs index da53265..3d66eea 100644 --- a/src/reader.rs +++ b/src/reader.rs @@ -2050,7 +2050,7 @@ impl<R: io::Read> Iterator for StringRecordsIntoIter<R> { fn next(&mut self) -> Option<Result<StringRecord>> { match self.rdr.read_record(&mut self.rec) { Err(err) => Some(Err(err)), - Ok(true) => Some(Ok(self.rec.clone())), + Ok(true) => Some(Ok(self.rec.clone_truncated())), Ok(false) => None, } } @@ -2087,7 +2087,7 @@ impl<'r, R: io::Read> Iterator for StringRecordsIter<'r, R> { fn next(&mut self) -> Option<Result<StringRecord>> { match self.rdr.read_record(&mut self.rec) { Err(err) => Some(Err(err)), - Ok(true) => Some(Ok(self.rec.clone())), + Ok(true) => Some(Ok(self.rec.clone_truncated())), Ok(false) => None, } } @@ -2126,7 +2126,7 @@ impl<R: io::Read> Iterator for ByteRecordsIntoIter<R> { fn next(&mut self) -> Option<Result<ByteRecord>> { match self.rdr.read_byte_record(&mut self.rec) { Err(err) => Some(Err(err)), - Ok(true) => Some(Ok(self.rec.clone())), + Ok(true) => Some(Ok(self.rec.clone_truncated())), Ok(false) => None, } } @@ -2163,7 +2163,7 @@ impl<'r, R: io::Read> Iterator for ByteRecordsIter<'r, R> { fn next(&mut self) -> Option<Result<ByteRecord>> { match self.rdr.read_byte_record(&mut self.rec) { Err(err) => Some(Err(err)), - Ok(true) => Some(Ok(self.rec.clone())), + Ok(true) => Some(Ok(self.rec.clone_truncated())), Ok(false) => None, } } 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`. diff --git a/src/writer.rs b/src/writer.rs index 6ab442f..a329d8d 100644 --- a/src/writer.rs +++ b/src/writer.rs @@ -777,7 +777,7 @@ impl<W: io::Write> Writer<W> { /// ## Non-Struct Containers /// /// Nested containers are flattened to their scalar components, with the - /// exeption of a few types that are not allowed: + /// exception of a few types that are not allowed: /// /// | Name | Example Type | Example Value | Output | /// | ---- | ---- | ---- | ---- | @@ -831,7 +831,7 @@ impl<W: io::Write> Writer<W> { /// ``` /// /// However, if `has_headers` were enabled in the above example, then - /// serialization would return an error. Speficially, when `has_headers` is + /// serialization would return an error. Specifically, when `has_headers` is /// `true`, there are two restrictions: /// /// 1. Named field values in structs must be scalars. |