diff options
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | .github/workflows/ci.yml | 30 | ||||
-rw-r--r-- | .travis.yml | 18 | ||||
-rw-r--r-- | Cargo.toml | 6 | ||||
-rw-r--r-- | Cargo.toml.orig | 7 | ||||
-rw-r--r-- | METADATA | 6 | ||||
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | tests/test.rs | 20 |
8 files changed, 61 insertions, 33 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 652f708..326754d 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "a3c7d4f0d396480243fd40b777bd3708e87ea80c" + "sha1": "ff47f2f0bbba62fcb2f892f5c488265b3bd7156f" } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4d4b341 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + pull_request: + schedule: [cron: "40 1 * * *"] + +jobs: + test: + name: Rust ${{matrix.rust}} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + rust: [nightly, beta, stable, 1.31.0] + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{matrix.rust}} + - run: cargo test + + minimal: + name: Minimal versions + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@nightly + - run: cargo -Z minimal-versions generate-lockfile + - run: cargo check --locked diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index da4d076..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: rust - -rust: - - 1.31.0 - - stable - - beta - - nightly - -script: cargo test - -matrix: - include: - - rust: nightly - name: Minimal versions - before_script: - - cargo -Z minimal-versions generate-lockfile - script: - - cargo check --locked @@ -13,7 +13,7 @@ [package] edition = "2018" name = "paste" -version = "0.1.11" +version = "0.1.12" authors = ["David Tolnay <dtolnay@gmail.com>"] description = "Macros for all your token pasting needs" readme = "README.md" @@ -22,7 +22,7 @@ repository = "https://github.com/dtolnay/paste" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies.paste-impl] -version = "=0.1.11" +version = "=0.1.12" [dependencies.proc-macro-hack] version = "0.5.9" @@ -31,5 +31,3 @@ version = "1.0" [dev-dependencies.trybuild] version = "1.0" -[badges.travis-ci] -repository = "dtolnay/paste" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 285cd55..a790489 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "paste" -version = "0.1.11" +version = "0.1.12" authors = ["David Tolnay <dtolnay@gmail.com>"] edition = "2018" license = "MIT OR Apache-2.0" @@ -8,11 +8,8 @@ description = "Macros for all your token pasting needs" repository = "https://github.com/dtolnay/paste" readme = "README.md" -[badges] -travis-ci = { repository = "dtolnay/paste" } - [dependencies] -paste-impl = { version = "=0.1.11", path = "impl" } +paste-impl = { version = "=0.1.12", path = "impl" } proc-macro-hack = "0.5.9" [dev-dependencies] @@ -9,11 +9,11 @@ third_party { type: GIT value: "https://github.com/dtolnay/paste" } - version: "0.1.11" + version: "0.1.12" license_type: NOTICE last_upgrade_date { year: 2020 - month: 4 - day: 27 + month: 5 + day: 4 } } @@ -126,8 +126,9 @@ Use `$var:lower` or `$var:upper` in the segment list to convert an interpolated segment to lower- or uppercase as part of the paste. For example, `[<ld_ $reg:lower _expr>]` would paste to `ld_bc_expr` if invoked with $reg=`Bc`. -Use `$var:snake` to convert CamelCase input to snake\_case. These compose, so -for example `$var:snake:upper` would give you SCREAMING\_CASE. +Use `$var:snake` to convert CamelCase input to snake\_case. +Use `$var:camel` to convert snake\_case to CamelCase. +These compose, so for example `$var:snake:upper` would give you SCREAMING\_CASE. The precise Unicode conversions are as defined by [`str::to_lowercase`] and [`str::to_uppercase`]. diff --git a/tests/test.rs b/tests/test.rs index e281c92..3aecd8d 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -172,6 +172,26 @@ mod test_none_delimited_single_ident { } } +mod test_none_delimited_single_lifetime { + macro_rules! m { + ($life:lifetime) => { + paste::item! { + pub struct S; + impl<$life> S { + fn f() {} + } + } + }; + } + + m!('a); + + #[test] + fn test() { + S::f(); + } +} + mod test_to_lower { macro_rules! m { ($id:ident) => { |