File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,16 @@ public struct KafkaAcknowledgedMessage {
40
40
throw KafkaError . rdKafkaError ( wrapping: rdKafkaMessage. err)
41
41
}
42
42
43
+ #if swift(<6.0)
43
44
guard let topic = String ( validatingUTF8: rd_kafka_topic_name ( rdKafkaMessage. rkt) ) else {
44
45
fatalError ( " Received topic name that is non-valid UTF-8 " )
45
46
}
47
+ #else
48
+ guard let topic = String ( validatingCString: rd_kafka_topic_name ( rdKafkaMessage. rkt) ) else {
49
+ fatalError ( " Received topic name that is non-valid UTF-8 " )
50
+ }
51
+ #endif
52
+
46
53
self . topic = topic
47
54
48
55
self . partition = KafkaPartition ( rawValue: Int ( rdKafkaMessage. partition) )
Original file line number Diff line number Diff line change @@ -52,9 +52,16 @@ public struct KafkaConsumerMessage {
52
52
}
53
53
}
54
54
55
+ #if swift(<6.0)
55
56
guard let topic = String ( validatingUTF8: rd_kafka_topic_name ( rdKafkaMessage. rkt) ) else {
56
57
fatalError ( " Received topic name that is non-valid UTF-8 " )
57
58
}
59
+ #else
60
+ guard let topic = String ( validatingCString: rd_kafka_topic_name ( rdKafkaMessage. rkt) ) else {
61
+ fatalError ( " Received topic name that is non-valid UTF-8 " )
62
+ }
63
+ #endif
64
+
58
65
self . topic = topic
59
66
60
67
self . partition = KafkaPartition ( rawValue: Int ( rdKafkaMessage. partition) )
You can’t perform that action at this time.
0 commit comments