diff options
author | Joel Galenson <jgalenson@google.com> | 2021-04-02 18:15:48 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-04-02 18:15:48 +0000 |
commit | fe3ac0341f43fcf283c8c5697dc86f675ef7fc62 (patch) | |
tree | b896b61a088e21510b50d6937f858254dc4beff5 | |
parent | 431569be6dc8b602bfb642a53714edcfe65bdafc (diff) | |
parent | 6b1e96e1af193743ad4bad031785e2d1d963450c (diff) | |
download | csv-android12-mainline-sdkext-release.tar.gz |
Upgrade rust/crates/csv to 1.1.6 am: 571ea99fb0 am: a993e2dc33 am: 6c5a3de18a am: 6b1e96e1afandroid-mainline-12.0.0_r99android-mainline-12.0.0_r98android-mainline-12.0.0_r97android-mainline-12.0.0_r96android-mainline-12.0.0_r95android-mainline-12.0.0_r94android-mainline-12.0.0_r93android-mainline-12.0.0_r92android-mainline-12.0.0_r91android-mainline-12.0.0_r90android-mainline-12.0.0_r9android-mainline-12.0.0_r89android-mainline-12.0.0_r88android-mainline-12.0.0_r87android-mainline-12.0.0_r86android-mainline-12.0.0_r85android-mainline-12.0.0_r84android-mainline-12.0.0_r83android-mainline-12.0.0_r82android-mainline-12.0.0_r81android-mainline-12.0.0_r80android-mainline-12.0.0_r8android-mainline-12.0.0_r79android-mainline-12.0.0_r78android-mainline-12.0.0_r77android-mainline-12.0.0_r76android-mainline-12.0.0_r75android-mainline-12.0.0_r74android-mainline-12.0.0_r73android-mainline-12.0.0_r72android-mainline-12.0.0_r71android-mainline-12.0.0_r70android-mainline-12.0.0_r7android-mainline-12.0.0_r69android-mainline-12.0.0_r68android-mainline-12.0.0_r67android-mainline-12.0.0_r66android-mainline-12.0.0_r65android-mainline-12.0.0_r64android-mainline-12.0.0_r63android-mainline-12.0.0_r62android-mainline-12.0.0_r61android-mainline-12.0.0_r60android-mainline-12.0.0_r6android-mainline-12.0.0_r59android-mainline-12.0.0_r58android-mainline-12.0.0_r57android-mainline-12.0.0_r56android-mainline-12.0.0_r53android-mainline-12.0.0_r52android-mainline-12.0.0_r51android-mainline-12.0.0_r50android-mainline-12.0.0_r5android-mainline-12.0.0_r49android-mainline-12.0.0_r48android-mainline-12.0.0_r47android-mainline-12.0.0_r46android-mainline-12.0.0_r45android-mainline-12.0.0_r44android-mainline-12.0.0_r43android-mainline-12.0.0_r42android-mainline-12.0.0_r41android-mainline-12.0.0_r40android-mainline-12.0.0_r39android-mainline-12.0.0_r38android-mainline-12.0.0_r37android-mainline-12.0.0_r35android-mainline-12.0.0_r34android-mainline-12.0.0_r33android-mainline-12.0.0_r32android-mainline-12.0.0_r31android-mainline-12.0.0_r30android-mainline-12.0.0_r3android-mainline-12.0.0_r29android-mainline-12.0.0_r28android-mainline-12.0.0_r27android-mainline-12.0.0_r26android-mainline-12.0.0_r25android-mainline-12.0.0_r24android-mainline-12.0.0_r23android-mainline-12.0.0_r22android-mainline-12.0.0_r21android-mainline-12.0.0_r20android-mainline-12.0.0_r2android-mainline-12.0.0_r19android-mainline-12.0.0_r18android-mainline-12.0.0_r17android-mainline-12.0.0_r16android-mainline-12.0.0_r15android-mainline-12.0.0_r14android-mainline-12.0.0_r13android-mainline-12.0.0_r126android-mainline-12.0.0_r125android-mainline-12.0.0_r124android-mainline-12.0.0_r123android-mainline-12.0.0_r122android-mainline-12.0.0_r121android-mainline-12.0.0_r120android-mainline-12.0.0_r12android-mainline-12.0.0_r119android-mainline-12.0.0_r118android-mainline-12.0.0_r117android-mainline-12.0.0_r116android-mainline-12.0.0_r115android-mainline-12.0.0_r114android-mainline-12.0.0_r113android-mainline-12.0.0_r110android-mainline-12.0.0_r11android-mainline-12.0.0_r109android-mainline-12.0.0_r108android-mainline-12.0.0_r107android-mainline-12.0.0_r106android-mainline-12.0.0_r105android-mainline-12.0.0_r104android-mainline-12.0.0_r103android-mainline-12.0.0_r102android-mainline-12.0.0_r101android-mainline-12.0.0_r100android-mainline-12.0.0_r10android-mainline-12.0.0_r1aml_wif_311811030aml_tz3_311312010aml_tet_311811050aml_sdk_311710000aml_pco_311011000aml_mpr_311911090aml_doc_310851020android12-mainline-wifi-releaseandroid12-mainline-tethering-releaseandroid12-mainline-statsd-releaseandroid12-mainline-sdkext-releaseandroid12-mainline-resolv-releaseandroid12-mainline-permission-releaseandroid12-mainline-neuralnetworks-releaseandroid12-mainline-networkstack-releaseandroid12-mainline-mediaprovider-releaseandroid12-mainline-media-swcodec-releaseandroid12-mainline-media-releaseandroid12-mainline-ipsec-releaseandroid12-mainline-extservices-releaseandroid12-mainline-documentsui-releaseandroid12-mainline-conscrypt-releaseandroid12-mainline-cellbroadcast-releaseandroid12-mainline-captiveportallogin-releaseandroid12-mainline-art-releaseandroid12-mainline-adbd-release
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/csv/+/1661950
Change-Id: I353d4c73b59bc7c204ad219f3a8eb0ff409e2eb2
-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. |