Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Sep 12, 2024
1 parent 604dea4 commit ec7c9cd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion frb_example/dart_minimal/rust/src/api/minimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ pub fn minimal_adder(a: i32, b: i32) -> i32 {
}

// TODO move
#[derive(Debug, PartialEq, Eq, Default, Clone)]
// #[derive(Debug, PartialEq, Eq, Default, Clone)]
#[derive(Debug)]
pub struct StructWithRustAutoOpaqueFieldWithManyDerive {
content: crate::frb_generated::RustAutoOpaque<String>,
}
8 changes: 8 additions & 0 deletions frb_rust/src/rust_auto_opaque/inner.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use crate::lockable::order::LockableOrder;
use std::fmt;
use std::fmt::Formatter;
use tokio::sync::RwLock;

pub struct RustAutoOpaqueInner<T> {
Expand All @@ -14,3 +16,9 @@ impl<T> RustAutoOpaqueInner<T> {
}
}
}

impl<T: fmt::Debug> fmt::Debug for RustAutoOpaqueInner<T> {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
self.data.fmt(f)
}
}
2 changes: 1 addition & 1 deletion frb_rust/src/rust_auto_opaque/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub(crate) mod inner;
pub(crate) mod rust2dart_common;
pub(crate) mod rust2dart_explicit;

#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct RustAutoOpaqueBase<T: 'static, A: BaseArc<inner::RustAutoOpaqueInner<T>>>(
pub(crate) RustOpaqueBase<inner::RustAutoOpaqueInner<T>, A>,
);
Expand Down

0 comments on commit ec7c9cd

Please sign in to comment.