From ec7c9cd671590c50be450f26ab521c84eb1379a4 Mon Sep 17 00:00:00 2001 From: fzyzcjy Date: Thu, 12 Sep 2024 09:08:37 +0800 Subject: [PATCH] debug --- frb_example/dart_minimal/rust/src/api/minimal.rs | 3 ++- frb_rust/src/rust_auto_opaque/inner.rs | 8 ++++++++ frb_rust/src/rust_auto_opaque/mod.rs | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/frb_example/dart_minimal/rust/src/api/minimal.rs b/frb_example/dart_minimal/rust/src/api/minimal.rs index 19423300d2..91f50e0026 100644 --- a/frb_example/dart_minimal/rust/src/api/minimal.rs +++ b/frb_example/dart_minimal/rust/src/api/minimal.rs @@ -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, } diff --git a/frb_rust/src/rust_auto_opaque/inner.rs b/frb_rust/src/rust_auto_opaque/inner.rs index 5a2fa16cf2..8fa696f133 100644 --- a/frb_rust/src/rust_auto_opaque/inner.rs +++ b/frb_rust/src/rust_auto_opaque/inner.rs @@ -1,4 +1,6 @@ use crate::lockable::order::LockableOrder; +use std::fmt; +use std::fmt::Formatter; use tokio::sync::RwLock; pub struct RustAutoOpaqueInner { @@ -14,3 +16,9 @@ impl RustAutoOpaqueInner { } } } + +impl fmt::Debug for RustAutoOpaqueInner { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + self.data.fmt(f) + } +} diff --git a/frb_rust/src/rust_auto_opaque/mod.rs b/frb_rust/src/rust_auto_opaque/mod.rs index 5ec9f25a82..6019804e24 100644 --- a/frb_rust/src/rust_auto_opaque/mod.rs +++ b/frb_rust/src/rust_auto_opaque/mod.rs @@ -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>>( pub(crate) RustOpaqueBase, A>, );