Convert a Rust snake_case method identifier to the tonic PascalCase gRPC method name (`list_sandboxes` → `ListSandboxes`).
(ident: &str)
| 179 | /// Convert a Rust snake_case method identifier to the tonic PascalCase |
| 180 | /// gRPC method name (`list_sandboxes` → `ListSandboxes`). |
| 181 | fn snake_to_pascal(ident: &str) -> String { |
| 182 | let mut out = String::with_capacity(ident.len()); |
| 183 | let mut upper_next = true; |
| 184 | for c in ident.chars() { |
| 185 | if c == '_' { |
| 186 | upper_next = true; |
| 187 | continue; |
| 188 | } |
| 189 | if upper_next { |
| 190 | out.extend(c.to_uppercase()); |
| 191 | upper_next = false; |
| 192 | } else { |
| 193 | out.push(c); |
| 194 | } |
| 195 | } |
| 196 | out |
| 197 | } |
| 198 | |
| 199 | /// Name of the per-service const emitted alongside the impl block. The |
| 200 | /// service module is what disambiguates between services — every impl |