Skip to content

Commit

Permalink
Simplify the message output
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Jun 17, 2024
1 parent 08d1784 commit f2363e4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions flutter_ffi_plugin/bin/src/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,9 @@ impl ${normalizePascal(messageName)} {
pub fn get_dart_signal_receiver()
-> Result<UnboundedReceiver<DartSignal<Self>>>
{
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)));
Expand All @@ -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)
}
}
Expand Down

0 comments on commit f2363e4

Please sign in to comment.