Skip to content

Commit

Permalink
fixed await/async in example
Browse files Browse the repository at this point in the history
  • Loading branch information
MnlPhlp committed Mar 10, 2024
1 parent f2247e5 commit 83139d7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn test(i: i32) {
### dart/flutter

```dart
void setupLogger(){
Future setupLogger() async {
setupLogStream().listen((msg){
// This should use a logging framework in real applications
print("${msg.logLevel} ${msg.lbl.padRight(8)}: ${msg.msg}");
Expand Down
3 changes: 1 addition & 2 deletions example/bin/dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import 'dart:io';

import 'api.dart';
import 'frb_generated.dart';
import 'dart:ffi' as ffi;

Future<void> setupLogger() async {
Future setupLogger() async {
infoLogger().listen((msg) {
// This should use a logging framework in real applications
print("${msg.logLevel} ${msg.lbl.padRight(8)}: ${msg.msg}");
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ macro_rules! flutter_logger_init {
use flutter_rust_bridge::frb;
pub use log::Level;

#[flutter_rust_bridge::frb(sync)]
pub fn $func_name(sink: frb_generated::StreamSink<flutter_logger::LogEntry>) {
flutter_logger::init(sink, $min_lvl).unwrap();
}
Expand Down

0 comments on commit 83139d7

Please sign in to comment.