diff options
author | Joel Galenson <jgalenson@google.com> | 2021-04-02 17:37:49 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-04-02 17:37:49 +0000 |
commit | 6b1e96e1af193743ad4bad031785e2d1d963450c (patch) | |
tree | b896b61a088e21510b50d6937f858254dc4beff5 | |
parent | 1622dfa52c333d6d3c90cbac253935adb75fd362 (diff) | |
parent | 6c5a3de18a1e4f062247f3136961e366075ba2e0 (diff) | |
download | csv-6b1e96e1af193743ad4bad031785e2d1d963450c.tar.gz |
Upgrade rust/crates/csv to 1.1.6 am: 571ea99fb0 am: a993e2dc33 am: 6c5a3de18aandroid-12.1.0_r9android-12.1.0_r8android-12.1.0_r7android-12.1.0_r26android-12.1.0_r25android-12.1.0_r24android-12.1.0_r23android-12.1.0_r22android-12.1.0_r21android-12.1.0_r20android-12.1.0_r19android-12.1.0_r18android-12.1.0_r17android-12.1.0_r16android-12.1.0_r15android-12.1.0_r14android-12.1.0_r13android-12.1.0_r12android-12.1.0_r11android-12.1.0_r10android-12.0.0_r32android-12.0.0_r29android-12.0.0_r28android-12.0.0_r27android-12.0.0_r26android-12.0.0_r21android-12.0.0_r20android-12.0.0_r19android-12.0.0_r18android-12.0.0_r16android12L-devandroid12L-d2-s8-releaseandroid12L-d2-s7-releaseandroid12L-d2-s6-releaseandroid12L-d2-s5-releaseandroid12L-d2-s4-releaseandroid12L-d2-s3-releaseandroid12L-d2-s2-releaseandroid12L-d2-s1-releaseandroid12L-d2-releaseandroid12-qpr3-s7-releaseandroid12-qpr3-s6-releaseandroid12-qpr3-s5-releaseandroid12-qpr3-s4-releaseandroid12-qpr3-s3-releaseandroid12-qpr3-s2-releaseandroid12-qpr3-s1-releaseandroid12-qpr3-releaseandroid12-qpr1-releaseandroid12-qpr1-d-s3-releaseandroid12-qpr1-d-s2-releaseandroid12-qpr1-d-s1-releaseandroid12-qpr1-d-releaseandroid12-dev
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/csv/+/1661950
Change-Id: Ifc568e66b7777c959157db42b8628d84d8c195c2
-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. |