mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-27 00:15:26 -04:00
lint work
This commit is contained in:
parent
9e4008214d
commit
6e8725f569
43 changed files with 257 additions and 332 deletions
|
@ -1,19 +1,16 @@
|
|||
import 'package:protobuf/protobuf.dart';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:protobuf/protobuf.dart';
|
||||
|
||||
Future<Uint8List> protobufUpdateBytes<T extends GeneratedMessage>(
|
||||
T Function(List<int>) fromBuffer,
|
||||
Uint8List oldBytes,
|
||||
Future<T> Function(T) update) async {
|
||||
T oldObj = fromBuffer(oldBytes);
|
||||
T newObj = await update(oldObj);
|
||||
final oldObj = fromBuffer(oldBytes);
|
||||
final newObj = await update(oldObj);
|
||||
return Uint8List.fromList(newObj.writeToBuffer());
|
||||
}
|
||||
|
||||
Future<Uint8List> Function(Uint8List)
|
||||
protobufUpdate<T extends GeneratedMessage>(
|
||||
T Function(List<int>) fromBuffer, Future<T> Function(T) update) {
|
||||
return (Uint8List oldBytes) {
|
||||
return protobufUpdateBytes(fromBuffer, oldBytes, update);
|
||||
};
|
||||
}
|
||||
T Function(List<int>) fromBuffer, Future<T> Function(T) update) => (oldBytes) => protobufUpdateBytes(fromBuffer, oldBytes, update);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue