@@ -104,12 +104,12 @@ private func readBytes(_ reader: inout (data: Data, offset: Data.Index), count:
104104
105105// Reads a float at the current offset.
106106private func readFloat( _ reader: inout ( data: Data , offset: Data . Index ) ) throws -> Float {
107- return Float ( bitPattern: try readInt ( & reader) )
107+ return try Float ( bitPattern: readInt ( & reader) )
108108}
109109
110110// Reads a float at the current offset.
111111private func readDouble( _ reader: inout ( data: Data , offset: Data . Index ) ) throws -> Double {
112- return Double ( bitPattern: try readInt ( & reader) )
112+ return try Double ( bitPattern: readInt ( & reader) )
113113}
114114
115115// Indicates if the offset has reached the end of the buffer.
@@ -267,7 +267,7 @@ private func makeRustCall<T>(_ callback: (UnsafeMutablePointer<RustCallStatus>)
267267 // with the message. But if that code panics, then it just sends back
268268 // an empty buffer.
269269 if callStatus. errorBuf. len > 0 {
270- throw UniffiInternalError . rustPanic ( try FfiConverterString . lift ( callStatus. errorBuf) )
270+ throw try UniffiInternalError . rustPanic ( FfiConverterString . lift ( callStatus. errorBuf) )
271271 } else {
272272 callStatus. errorBuf. deallocate ( )
273273 throw UniffiInternalError . rustPanic ( " Rust panic " )
@@ -342,7 +342,7 @@ private struct FfiConverterString: FfiConverter {
342342
343343 public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> String {
344344 let len : Int32 = try readInt ( & buf)
345- return String ( bytes: try readBytes ( & buf, count: Int ( len) ) , encoding: String . Encoding. utf8) !
345+ return try String ( bytes: readBytes ( & buf, count: Int ( len) ) , encoding: String . Encoding. utf8) !
346346 }
347347
348348 public static func write( _ value: String , into buf: inout [ UInt8 ] ) {
@@ -382,7 +382,7 @@ public class Client: ClientProtocol {
382382 }
383383
384384 public convenience init ( jid: FullJid , cacheDir: String , delegate: ClientDelegate ? ) throws {
385- self . init ( unsafeFromRawPointer: try rustCallWithError ( FfiConverterTypeClientError . self) {
385+ try self . init ( unsafeFromRawPointer: rustCallWithError ( FfiConverterTypeClientError . self) {
386386 prose_core_ffi_b073_Client_new (
387387 FfiConverterTypeFullJid . lower ( jid) ,
388388 FfiConverterString . lower ( cacheDir) ,
@@ -2004,27 +2004,27 @@ public struct FfiConverterTypeClientEvent: FfiConverterRustBuffer {
20042004 public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> ClientEvent {
20052005 let variant : Int32 = try readInt ( & buf)
20062006 switch variant {
2007- case 1 : return . connectionStatusChanged(
2008- event: try FfiConverterTypeConnectionEvent . read ( from: & buf)
2007+ case 1 : return try . connectionStatusChanged(
2008+ event: FfiConverterTypeConnectionEvent . read ( from: & buf)
20092009 )
20102010
2011- case 2 : return . contactChanged(
2012- jid: try FfiConverterTypeBareJid . read ( from: & buf)
2011+ case 2 : return try . contactChanged(
2012+ jid: FfiConverterTypeBareJid . read ( from: & buf)
20132013 )
20142014
2015- case 3 : return . messagesAppended(
2016- conversation: try FfiConverterTypeBareJid . read ( from: & buf) ,
2017- messageIds: try FfiConverterSequenceTypeMessageId . read ( from: & buf)
2015+ case 3 : return try . messagesAppended(
2016+ conversation: FfiConverterTypeBareJid . read ( from: & buf) ,
2017+ messageIds: FfiConverterSequenceTypeMessageId . read ( from: & buf)
20182018 )
20192019
2020- case 4 : return . messagesUpdated(
2021- conversation: try FfiConverterTypeBareJid . read ( from: & buf) ,
2022- messageIds: try FfiConverterSequenceTypeMessageId . read ( from: & buf)
2020+ case 4 : return try . messagesUpdated(
2021+ conversation: FfiConverterTypeBareJid . read ( from: & buf) ,
2022+ messageIds: FfiConverterSequenceTypeMessageId . read ( from: & buf)
20232023 )
20242024
2025- case 5 : return . messagesDeleted(
2026- conversation: try FfiConverterTypeBareJid . read ( from: & buf) ,
2027- messageIds: try FfiConverterSequenceTypeMessageId . read ( from: & buf)
2025+ case 5 : return try . messagesDeleted(
2026+ conversation: FfiConverterTypeBareJid . read ( from: & buf) ,
2027+ messageIds: FfiConverterSequenceTypeMessageId . read ( from: & buf)
20282028 )
20292029
20302030 default : throw UniffiInternalError . unexpectedEnumCase
@@ -2084,8 +2084,8 @@ public struct FfiConverterTypeConnectionEvent: FfiConverterRustBuffer {
20842084 switch variant {
20852085 case 1 : return . connect
20862086
2087- case 2 : return . disconnect(
2088- error: try FfiConverterTypeConnectionError . read ( from: & buf)
2087+ case 2 : return try . disconnect(
2088+ error: FfiConverterTypeConnectionError . read ( from: & buf)
20892089 )
20902090
20912091 default : throw UniffiInternalError . unexpectedEnumCase
@@ -2238,8 +2238,8 @@ public struct FfiConverterTypeClientError: FfiConverterRustBuffer {
22382238 public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> ClientError {
22392239 let variant : Int32 = try readInt ( & buf)
22402240 switch variant {
2241- case 1 : return . Generic(
2242- msg: try FfiConverterString . read ( from: & buf)
2241+ case 1 : return try . Generic(
2242+ msg: FfiConverterString . read ( from: & buf)
22432243 )
22442244
22452245 default : throw UniffiInternalError . unexpectedEnumCase
@@ -2273,8 +2273,8 @@ public struct FfiConverterTypeConnectionError: FfiConverterRustBuffer {
22732273 switch variant {
22742274 case 1 : return . TimedOut
22752275 case 2 : return . InvalidCredentials
2276- case 3 : return . Generic(
2277- msg: try FfiConverterString . read ( from: & buf)
2276+ case 3 : return try . Generic(
2277+ msg: FfiConverterString . read ( from: & buf)
22782278 )
22792279
22802280 default : throw UniffiInternalError . unexpectedEnumCase
@@ -2320,20 +2320,20 @@ public struct FfiConverterTypeJidParseError: FfiConverterRustBuffer {
23202320 public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> JidParseError {
23212321 let variant : Int32 = try readInt ( & buf)
23222322 switch variant {
2323- case 1 : return . NoDomain(
2324- message: try FfiConverterString . read ( from: & buf)
2323+ case 1 : return try . NoDomain(
2324+ message: FfiConverterString . read ( from: & buf)
23252325 )
23262326
2327- case 2 : return . NoResource(
2328- message: try FfiConverterString . read ( from: & buf)
2327+ case 2 : return try . NoResource(
2328+ message: FfiConverterString . read ( from: & buf)
23292329 )
23302330
2331- case 3 : return . EmptyNode(
2332- message: try FfiConverterString . read ( from: & buf)
2331+ case 3 : return try . EmptyNode(
2332+ message: FfiConverterString . read ( from: & buf)
23332333 )
23342334
2335- case 4 : return . EmptyResource(
2336- message: try FfiConverterString . read ( from: & buf)
2335+ case 4 : return try . EmptyResource(
2336+ message: FfiConverterString . read ( from: & buf)
23372337 )
23382338
23392339 default : throw UniffiInternalError . unexpectedEnumCase
@@ -2441,7 +2441,7 @@ private let foreignCallbackCallbackInterfaceClientDelegate: ForeignCallback =
24412441 var reader = createReader ( data: Data ( bytes: argsData, count: Int ( argsLen) ) )
24422442 func makeCall( ) throws -> Int32 {
24432443 try swiftCallbackInterface. handleEvent (
2444- event: try FfiConverterTypeClientEvent . read ( from: & reader)
2444+ event: FfiConverterTypeClientEvent . read ( from: & reader)
24452445 )
24462446 return UNIFFI_CALLBACK_SUCCESS
24472447 }
@@ -2543,8 +2543,8 @@ private let foreignCallbackCallbackInterfaceLogger: ForeignCallback =
25432543 var reader = createReader ( data: Data ( bytes: argsData, count: Int ( argsLen) ) )
25442544 func makeCall( ) throws -> Int32 {
25452545 try swiftCallbackInterface. log (
2546- level: try FfiConverterTypeLogLevel . read ( from: & reader) ,
2547- message: try FfiConverterString . read ( from: & reader)
2546+ level: FfiConverterTypeLogLevel . read ( from: & reader) ,
2547+ message: FfiConverterString . read ( from: & reader)
25482548 )
25492549 return UNIFFI_CALLBACK_SUCCESS
25502550 }
@@ -2795,7 +2795,7 @@ private struct FfiConverterSequenceString: FfiConverterRustBuffer {
27952795 var seq = [ String] ( )
27962796 seq. reserveCapacity ( Int ( len) )
27972797 for _ in 0 ..< len {
2798- seq. append ( try FfiConverterString . read ( from: & buf) )
2798+ try seq. append ( FfiConverterString . read ( from: & buf) )
27992799 }
28002800 return seq
28012801 }
@@ -2817,7 +2817,7 @@ private struct FfiConverterSequenceTypeBareJid: FfiConverterRustBuffer {
28172817 var seq = [ BareJid] ( )
28182818 seq. reserveCapacity ( Int ( len) )
28192819 for _ in 0 ..< len {
2820- seq. append ( try FfiConverterTypeBareJid . read ( from: & buf) )
2820+ try seq. append ( FfiConverterTypeBareJid . read ( from: & buf) )
28212821 }
28222822 return seq
28232823 }
@@ -2839,7 +2839,7 @@ private struct FfiConverterSequenceTypeContact: FfiConverterRustBuffer {
28392839 var seq = [ Contact] ( )
28402840 seq. reserveCapacity ( Int ( len) )
28412841 for _ in 0 ..< len {
2842- seq. append ( try FfiConverterTypeContact . read ( from: & buf) )
2842+ try seq. append ( FfiConverterTypeContact . read ( from: & buf) )
28432843 }
28442844 return seq
28452845 }
@@ -2861,7 +2861,7 @@ private struct FfiConverterSequenceTypeMessage: FfiConverterRustBuffer {
28612861 var seq = [ Message] ( )
28622862 seq. reserveCapacity ( Int ( len) )
28632863 for _ in 0 ..< len {
2864- seq. append ( try FfiConverterTypeMessage . read ( from: & buf) )
2864+ try seq. append ( FfiConverterTypeMessage . read ( from: & buf) )
28652865 }
28662866 return seq
28672867 }
@@ -2883,7 +2883,7 @@ private struct FfiConverterSequenceTypeReaction: FfiConverterRustBuffer {
28832883 var seq = [ Reaction] ( )
28842884 seq. reserveCapacity ( Int ( len) )
28852885 for _ in 0 ..< len {
2886- seq. append ( try FfiConverterTypeReaction . read ( from: & buf) )
2886+ try seq. append ( FfiConverterTypeReaction . read ( from: & buf) )
28872887 }
28882888 return seq
28892889 }
@@ -2905,7 +2905,7 @@ private struct FfiConverterSequenceTypeMessageId: FfiConverterRustBuffer {
29052905 var seq = [ MessageId] ( )
29062906 seq. reserveCapacity ( Int ( len) )
29072907 for _ in 0 ..< len {
2908- seq. append ( try FfiConverterTypeMessageId . read ( from: & buf) )
2908+ try seq. append ( FfiConverterTypeMessageId . read ( from: & buf) )
29092909 }
29102910 return seq
29112911 }
@@ -3123,7 +3123,7 @@ public func formatJid(jid: BareJid) -> String {
31233123
31243124public func parseJid( jid: String ) throws -> BareJid {
31253125 return try FfiConverterTypeBareJid . lift (
3126- try rustCallWithError ( FfiConverterTypeJidParseError . self) {
3126+ rustCallWithError ( FfiConverterTypeJidParseError . self) {
31273127 _uniffi_prose_core_ffi_parse_jid_5ef6 (
31283128 FfiConverterString . lower ( jid) , $0
31293129 )
0 commit comments