Skip to content

Commit

Permalink
cxx-qt-gen: split rust/types and cpp/types into a cxx utils module
Browse files Browse the repository at this point in the history
This allows us to have a separate module for independent helpers
for dealing with syn, CXX, and C++ together.

Related to KDAB#404
  • Loading branch information
ahayzen-kdab committed Jul 4, 2023
1 parent b1f7da5 commit db82235
Show file tree
Hide file tree
Showing 8 changed files with 648 additions and 607 deletions.
546 changes: 3 additions & 543 deletions crates/cxx-qt-gen/src/generator/cpp/types.rs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions crates/cxx-qt-gen/src/generator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
pub mod cpp;
pub mod naming;
pub mod rust;
pub mod utils;
1 change: 0 additions & 1 deletion crates/cxx-qt-gen/src/generator/rust/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub mod property;
pub mod qobject;
pub mod signals;
pub mod threading;
pub mod types;

use crate::generator::rust::qobject::GeneratedRustQObject;
use crate::parser::Parser;
Expand Down
5 changes: 3 additions & 2 deletions crates/cxx-qt-gen/src/generator/rust/property/setter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

use crate::generator::{
naming::{property::QPropertyName, qobject::QObjectName},
rust::{fragment::RustFragmentPair, types::is_unsafe_cxx_type},
rust::fragment::RustFragmentPair,
utils::rust::syn_type_is_cxx_bridge_unsafe,
};
use quote::quote;
use syn::Type;
Expand All @@ -24,7 +25,7 @@ pub fn generate(
let notify_ident = &idents.notify.rust;

// Determine if unsafe is required due to an unsafe type
let has_unsafe = if is_unsafe_cxx_type(ty) {
let has_unsafe = if syn_type_is_cxx_bridge_unsafe(ty) {
quote! { unsafe }
} else {
quote! {}
Expand Down
61 changes: 0 additions & 61 deletions crates/cxx-qt-gen/src/generator/rust/types.rs

This file was deleted.

Loading

0 comments on commit db82235

Please sign in to comment.