diff options
author | Haibo Huang <hhb@google.com> | 2020-04-27 13:16:53 -0700 |
---|---|---|
committer | Haibo Huang <hhb@google.com> | 2020-04-27 13:16:53 -0700 |
commit | eeaf47fc4dddcea4f6b4e0d4e3247f11c477e284 (patch) | |
tree | d1b8d1fc1d6665a6a6aec7002411737ada77e527 | |
parent | 19811483df3157e4b67243eb121c0d98cf20a239 (diff) | |
download | paste-impl-eeaf47fc4dddcea4f6b4e0d4e3247f11c477e284.tar.gz |
Upgrade rust/crates/paste-impl to 0.1.11
Test: None
Change-Id: Iac6867d0452bf916c9b5726febff025fc6c71124
-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 | 4 | ||||
-rw-r--r-- | src/lib.rs | 20 |
5 files changed, 25 insertions, 5 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 28d7b30..652f708 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "5feb37605c9ec2d237651dbd669e3527566a839e" + "sha1": "a3c7d4f0d396480243fd40b777bd3708e87ea80c" } } @@ -13,7 +13,7 @@ [package] edition = "2018" name = "paste-impl" -version = "0.1.10" +version = "0.1.11" 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 9b7a04e..a11873f 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "paste-impl" -version = "0.1.10" +version = "0.1.11" authors = ["David Tolnay <dtolnay@gmail.com>"] edition = "2018" license = "MIT OR Apache-2.0" @@ -9,11 +9,11 @@ third_party { type: GIT value: "https://github.com/dtolnay/paste" } - version: "0.1.10" + version: "0.1.11" license_type: NOTICE last_upgrade_date { year: 2020 month: 4 - day: 17 + day: 27 } } @@ -194,6 +194,26 @@ fn paste_segments(span: Span, segments: &[Segment]) -> Result<TokenStream> { prev = ch; } evaluated.push(acc.to_lowercase()); + } else if ident == "camel" { + let mut acc = String::new(); + let mut prev = '_'; + for ch in last.chars() { + if ch != '_' { + if prev == '_' { + for chu in ch.to_uppercase() { + acc.push(chu); + } + } else if prev.is_uppercase() { + for chl in ch.to_lowercase() { + acc.push(chl); + } + } else { + acc.push(ch); + } + } + prev = ch; + } + evaluated.push(acc); } else { return Err(Error::new_spanned(span, "unsupported modifier")); } |