Skip to content

Commit e0df577

Browse files
stepanchegfacebook-github-bot
authored andcommitted
Avoid gazebo str_pattern_extensions
Summary: Requires nightly. Reviewed By: bobyangyf Differential Revision: D41091467 fbshipit-source-id: f7b6cc23bf801c531e4d43f2995f445e73f1ec3e
1 parent f6aee2b commit e0df577

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

starlark_derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ proc-macro = true
1414
[dependencies]
1515
proc-macro2 = "1.0"
1616
syn = { version = "1.0.96", features = ["full", "extra-traits", "visit"] }
17-
gazebo = { workspace = true, features = ["str_pattern_extensions"] }
1817
gazebo_lint.version = "0.1"
1918
gazebo_lint.optional = true
2019
# @oss-disable: gazebo_lint.path = "../../gazebo_lint/gazebo_lint"
20+
gazebo = { workspace = true }
2121
quote = "1.0"
2222

2323
[features]

starlark_derive/src/module/util.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
use gazebo::prelude::*;
1918
use proc_macro2::TokenStream;
2019
use quote::quote;
2120
use syn::*;
@@ -35,7 +34,11 @@ pub(crate) fn is_type_name(x: &Type, name: &str) -> bool {
3534
}
3635

3736
pub(crate) fn ident_string(x: &Ident) -> String {
38-
x.to_string().trim_start_match("r#").to_owned()
37+
let x = x.to_string();
38+
match x.strip_prefix("r#") {
39+
Some(x) => x.to_owned(),
40+
None => x,
41+
}
3942
}
4043

4144
pub(crate) fn mut_token(x: bool) -> TokenStream {

0 commit comments

Comments
 (0)