File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
bindgen-tests/tests/parse_callbacks Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -123,14 +123,6 @@ impl ParseCallbacks for WrapAsVariadicFn {
123
123
}
124
124
125
125
pub fn lookup ( cb : & str ) -> Box < dyn ParseCallbacks > {
126
- fn try_strip_prefix < ' a > ( s : & ' a str , prefix : & str ) -> Option < & ' a str > {
127
- if s. starts_with ( prefix) {
128
- Some ( & s[ prefix. len ( ) ..] )
129
- } else {
130
- None
131
- }
132
- }
133
-
134
126
match cb {
135
127
"enum-variant-rename" => Box :: new ( EnumVariantRename ) ,
136
128
"blocklisted-type-implements-trait" => {
@@ -139,17 +131,17 @@ pub fn lookup(cb: &str) -> Box<dyn ParseCallbacks> {
139
131
"wrap-as-variadic-fn" => Box :: new ( WrapAsVariadicFn ) ,
140
132
call_back => {
141
133
if let Some ( prefix) =
142
- try_strip_prefix ( call_back, "remove-function-prefix-" )
134
+ call_back. strip_prefix ( "remove-function-prefix-" )
143
135
{
144
136
let lnopc = RemovePrefixParseCallback :: new ( prefix) ;
145
137
Box :: new ( lnopc)
146
138
} else if let Some ( prefix) =
147
- try_strip_prefix ( call_back, "prefix-link-name-" )
139
+ call_back. strip_prefix ( "prefix-link-name-" )
148
140
{
149
141
let plnpc = PrefixLinkNameParseCallback :: new ( prefix) ;
150
142
Box :: new ( plnpc)
151
143
} else if let Some ( default) =
152
- try_strip_prefix ( call_back, "field-visibility-default-" )
144
+ call_back. strip_prefix ( "field-visibility-default-" )
153
145
{
154
146
Box :: new ( FieldVisibility {
155
147
default : default. parse ( ) . expect (
You can’t perform that action at this time.
0 commit comments