From f2363e4454ac00b7754adec23858e7b21b468cbf Mon Sep 17 00:00:00 2001 From: Donghyun Kim Date: Mon, 17 Jun 2024 23:37:56 +0900 Subject: [PATCH] Simplify the message output --- flutter_ffi_plugin/bin/src/message.dart | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/flutter_ffi_plugin/bin/src/message.dart b/flutter_ffi_plugin/bin/src/message.dart index 79ddeaa0..3aa6a836 100644 --- a/flutter_ffi_plugin/bin/src/message.dart +++ b/flutter_ffi_plugin/bin/src/message.dart @@ -294,10 +294,9 @@ impl ${normalizePascal(messageName)} { pub fn get_dart_signal_receiver() -> Result>> { - let mut guard = - ${snakeName.toUpperCase()}_CHANNEL.lock().map_err(|_| { - String::from("Could not acquire the channel lock.") - })?; + let mut guard = ${snakeName.toUpperCase()}_CHANNEL + .lock() + .map_err(|_| "Could not acquire the channel lock.")?; if guard.is_none() { let (sender, receiver) = unbounded_channel(); guard.replace((sender, Some(receiver))); @@ -321,7 +320,7 @@ impl ${normalizePascal(messageName)} { guard.replace((pair.0, None)); let receiver = pair .1 - .ok_or("Each Dart signal receiver can be taken only once")?; + .ok_or("Each Dart signal receiver can be taken only once.")?; Ok(receiver) } }