Skip to content

Commit b18d5e6

Browse files
committed
Remove the bridging method without BinaryEncodingOptions.
Since `main` is going to be 2.0, it is accepting breaking changes, so we don't need to keep the shim without the argument, we can just have the newer signature with the default provided there.
1 parent 399023c commit b18d5e6

File tree

2 files changed

+2
-32
lines changed

2 files changed

+2
-32
lines changed

Sources/SwiftProtobuf/Message+BinaryAdditions.swift

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,6 @@ import Foundation
1616

1717
/// Binary encoding and decoding methods for messages.
1818
extension Message {
19-
/// Returns a `SwiftProtobufContiguousBytes` instance containing the Protocol Buffer binary
20-
/// format serialization of the message.
21-
///
22-
/// - Parameters:
23-
/// - partial: If `false` (the default), this method will check
24-
/// `Message.isInitialized` before encoding to verify that all required
25-
/// fields are present. If any are missing, this method throws.
26-
/// `BinaryEncodingError.missingRequiredFields`.
27-
/// - Returns: A `SwiftProtobufContiguousBytes` instance containing the binary serialization
28-
/// of the message.
29-
///
30-
/// - Throws: `BinaryEncodingError` if encoding fails.
31-
public func serializedBytes<Bytes: SwiftProtobufContiguousBytes>(partial: Bool = false) throws -> Bytes {
32-
try serializedBytes(partial: partial, options: BinaryEncodingOptions())
33-
}
34-
3519
/// Returns a `SwiftProtobufContiguousBytes` instance containing the Protocol Buffer binary
3620
/// format serialization of the message.
3721
///
@@ -47,7 +31,7 @@ extension Message {
4731
/// - Throws: `BinaryEncodingError` if encoding fails.
4832
public func serializedBytes<Bytes: SwiftProtobufContiguousBytes>(
4933
partial: Bool = false,
50-
options: BinaryEncodingOptions
34+
options: BinaryEncodingOptions = BinaryEncodingOptions()
5135
) throws -> Bytes {
5236
if !partial && !isInitialized {
5337
throw BinaryEncodingError.missingRequiredFields

Sources/SwiftProtobuf/Message+BinaryAdditions_Data.swift

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,6 @@ extension Message {
7070
try merge(serializedBytes: data, extensions: extensions, partial: partial, options: options)
7171
}
7272

73-
/// Returns a `Data` instance containing the Protocol Buffer binary
74-
/// format serialization of the message.
75-
///
76-
/// - Parameters:
77-
/// - partial: If `false` (the default), this method will check
78-
/// `Message.isInitialized` before encoding to verify that all required
79-
/// fields are present. If any are missing, this method throws
80-
/// `BinaryEncodingError.missingRequiredFields`.
81-
/// - Returns: A `Data` instance containing the binary serialization of the message.
82-
/// - Throws: `BinaryEncodingError` if encoding fails.
83-
public func serializedData(partial: Bool = false) throws -> Data {
84-
try serializedBytes(partial: partial, options: BinaryEncodingOptions())
85-
}
86-
8773
/// Returns a `Data` instance containing the Protocol Buffer binary
8874
/// format serialization of the message.
8975
///
@@ -97,7 +83,7 @@ extension Message {
9783
/// - Throws: `BinaryEncodingError` if encoding fails.
9884
public func serializedData(
9985
partial: Bool = false,
100-
options: BinaryEncodingOptions
86+
options: BinaryEncodingOptions = BinaryEncodingOptions()
10187
) throws -> Data {
10288
try serializedBytes(partial: partial, options: options)
10389
}

0 commit comments

Comments
 (0)