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:54 -0700 |
commit | 443b81192a3334af2ba82214bc38c60f21fc6e7c (patch) | |
tree | f194791b298b023f2ef01c3e38d8fe6f662b9266 /README.md | |
parent | 1e8b07068e8a586ce0b2d66e46a5d435fdb842f8 (diff) | |
download | paste-443b81192a3334af2ba82214bc38c60f21fc6e7c.tar.gz |
Add OWNERS; upgrade to 0.1.10
Test: make
Change-Id: Ic829168a6947d2d67d245439f4fe33a91a5fba75
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -21,6 +21,8 @@ paste = "0.1" This approach works with any stable or nightly Rust compiler 1.30+. +<br> + ## Pasting identifiers There are two entry points, `paste::expr!` for macros in expression position and @@ -45,6 +47,8 @@ fn main() { } ``` +<br> + ## More elaborate examples This program demonstrates how you may want to bundle a paste invocation inside @@ -116,6 +120,23 @@ fn call_some_getters(s: &S) -> bool { <br> +## Case conversion + +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. + +The precise Unicode conversions are as defined by [`str::to_lowercase`] and +[`str::to_uppercase`]. + +[`str::to_lowercase`]: https://doc.rust-lang.org/std/primitive.str.html#method.to_lowercase +[`str::to_uppercase`]: https://doc.rust-lang.org/std/primitive.str.html#method.to_uppercase + +<br> + #### License <sup> |