We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a8f2634 commit df74d0eCopy full SHA for df74d0e
tests/parse_callbacks/mod.rs
@@ -16,8 +16,8 @@ impl RemoveFunctionPrefixParseCallback {
16
impl ParseCallbacks for RemoveFunctionPrefixParseCallback {
17
fn generated_name_override(&self, function_name: &str) -> Option<String> {
18
if let Some(prefix) = &self.remove_function_prefix {
19
- if function_name.starts_with(prefix) {
20
- return Some(function_name[prefix.len()..].to_string());
+ if let Some(name) = function_name.strip_prefix(prefix) {
+ return Some(name.to_string())
21
}
22
23
None
0 commit comments