opencv_binding_generator/writer/rust_native/string_ext.rs
use crate::{NameStyle, StrExt};
use std::borrow::Cow;
pub trait RustStringExt {
fn rust_name_from_fullname(&self, style: NameStyle) -> Cow<str>;
}
impl RustStringExt for str {
fn rust_name_from_fullname(&self, style: NameStyle) -> Cow<str> {
match style {
NameStyle::Declaration => self.localname().into(),
NameStyle::Reference(fish) => fish.apply(self),
}
}
}