Skip to content

Commit

Permalink
CombinedIdent: Revert From<Ident> implementation
Browse files Browse the repository at this point in the history
Use associated function `from_rust_function` instead.
  • Loading branch information
LeonMatthesKDAB committed Dec 7, 2022
1 parent 65fbd42 commit f0e8d45
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/cxx-qt-gen/src/generator/naming/invokable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl From<&ImplItemMethod> for QInvokableName {
fn from(method: &ImplItemMethod) -> Self {
let ident = &method.sig.ident;
Self {
name: ident.clone().into(),
name: CombinedIdent::from_rust_function(ident.clone()),
wrapper: wrapper_from_ident(ident),
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/cxx-qt-gen/src/generator/naming/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ pub struct CombinedIdent {
pub rust: Ident,
}

impl From<Ident> for CombinedIdent {
fn from(ident: Ident) -> Self {
impl CombinedIdent {
pub fn from_rust_function(ident: Ident) -> Self {
Self {
cpp: format_ident!("{}", ident.to_string().to_case(Case::Camel)),
rust: ident,
Expand Down
2 changes: 1 addition & 1 deletion crates/cxx-qt-gen/src/parser/inherit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl ParsedInheritedMethod {

let parameters = ParsedFunctionParameter::parse_all_without_receiver(&method.sig)?;

let mut ident = CombinedIdent::from(method.sig.ident.clone());
let mut ident = CombinedIdent::from_rust_function(method.sig.ident.clone());
for attribute in &method.attrs {
if !attribute.path.is_ident(&format_ident!("cxx_name")) {
return Err(Error::new(
Expand Down

0 comments on commit f0e8d45

Please sign in to comment.