diff options
author | Chih-Hung Hsieh <chh@google.com> | 2020-04-17 14:32:19 -0700 |
---|---|---|
committer | Chih-Hung Hsieh <chh@google.com> | 2020-04-17 14:56:33 -0700 |
commit | 19811483df3157e4b67243eb121c0d98cf20a239 (patch) | |
tree | 1b8c1d3f08ca59b539a341125610c6af7e70fa9a | |
parent | a1b325846b1eb3f6de63cf424d5399faf83693bd (diff) | |
download | paste-impl-19811483df3157e4b67243eb121c0d98cf20a239.tar.gz |
Add OWNERS; upgrade to 0.1.10
Test: make
Change-Id: I146d751b4d95f3f8c1cc0309075c675f3d0d0697
-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")); } |