diff options
author | Chih-Hung Hsieh <chh@google.com> | 2020-04-18 03:22:37 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-04-18 03:22:37 +0000 |
commit | 30938b47d3d8ed46791dd6ca96e8ec910dfb84ee (patch) | |
tree | 1b8c1d3f08ca59b539a341125610c6af7e70fa9a | |
parent | d43a441ad03b1bae46557f2f31252ddb19bcc458 (diff) | |
parent | 19811483df3157e4b67243eb121c0d98cf20a239 (diff) | |
download | paste-impl-30938b47d3d8ed46791dd6ca96e8ec910dfb84ee.tar.gz |
Add OWNERS; upgrade to 0.1.10 am: 19811483df
Change-Id: I9f236055eacd929787a37f3d911eeb57364d8928
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | METADATA | 12 | ||||
-rw-r--r-- | OWNERS | 1 | ||||
-rw-r--r-- | src/lib.rs | 13 |
6 files changed, 24 insertions, 8 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 984f7e4..28d7b30 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "68b6baab911f1fdf9d3ab1d3b3ab08b73b28d21a" + "sha1": "5feb37605c9ec2d237651dbd669e3527566a839e" } } @@ -13,7 +13,7 @@ [package] edition = "2018" name = "paste-impl" -version = "0.1.8" +version = "0.1.10" authors = ["David Tolnay <dtolnay@gmail.com>"] description = "Implementation detail of the `paste` crate" license = "MIT OR Apache-2.0" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 8082791..9b7a04e 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "paste-impl" -version = "0.1.8" +version = "0.1.10" authors = ["David Tolnay <dtolnay@gmail.com>"] edition = "2018" license = "MIT OR Apache-2.0" @@ -1,7 +1,5 @@ name: "paste-impl" -description: - "Implementation detail of the `paste` crate" - +description: "Implementation detail of the `paste` crate" third_party { url { type: HOMEPAGE @@ -11,7 +9,11 @@ third_party { type: GIT value: "https://github.com/dtolnay/paste" } - version: "0.1.8" - last_upgrade_date { year: 2020 month: 3 day: 19 } + version: "0.1.10" license_type: NOTICE + last_upgrade_date { + year: 2020 + month: 4 + day: 17 + } } @@ -0,0 +1 @@ +include platform/prebuilts/rust:/OWNERS @@ -181,6 +181,19 @@ fn paste_segments(span: Span, segments: &[Segment]) -> Result<TokenStream> { }; if ident == "lower" { evaluated.push(last.to_lowercase()); + } else if ident == "upper" { + evaluated.push(last.to_uppercase()); + } else if ident == "snake" { + let mut acc = String::new(); + let mut prev = '_'; + for ch in last.chars() { + if ch.is_uppercase() && prev != '_' { + acc.push('_'); + } + acc.push(ch); + prev = ch; + } + evaluated.push(acc.to_lowercase()); } else { return Err(Error::new_spanned(span, "unsupported modifier")); } |