summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2020-04-27 13:16:53 -0700
committerHaibo Huang <hhb@google.com>2020-04-27 13:16:53 -0700
commiteeaf47fc4dddcea4f6b4e0d4e3247f11c477e284 (patch)
treed1b8d1fc1d6665a6a6aec7002411737ada77e527
parent19811483df3157e4b67243eb121c0d98cf20a239 (diff)
downloadpaste-impl-eeaf47fc4dddcea4f6b4e0d4e3247f11c477e284.tar.gz
Upgrade rust/crates/paste-impl to 0.1.11
Test: None Change-Id: Iac6867d0452bf916c9b5726febff025fc6c71124
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Cargo.toml2
-rw-r--r--Cargo.toml.orig2
-rw-r--r--METADATA4
-rw-r--r--src/lib.rs20
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"
}
}
diff --git a/Cargo.toml b/Cargo.toml
index 90aff3f..e18833f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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"
diff --git a/METADATA b/METADATA
index e289934..e62bf34 100644
--- a/METADATA
+++ b/METADATA
@@ -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
}
}
diff --git a/src/lib.rs b/src/lib.rs
index b2c1e41..b62929d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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"));
}