Skip to content

Commit

Permalink
Fixed a compilation issue due to a misplaced async
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitribouniol committed Mar 5, 2022
1 parent ec15d7f commit 879f078
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/Bytes/Integer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ extension IteratorProtocol where Element == Byte {
/// - Returns: An integer of type `type`, or `nil` if the sequence is finished.
/// - Throws: `BytesError.invalidMemorySize` if a complete integer could not be returned by the time the sequence ended.
@inlinable
public mutating func nextIfPresent<T: FixedWidthInteger>(bigEndian type: T.Type) async throws -> T? {
public mutating func nextIfPresent<T: FixedWidthInteger>(bigEndian type: T.Type) throws -> T? {
try nextIfPresent(bytes: Bytes.self, count: MemoryLayout<T>.size).map { try T(bigEndianBytes: $0) }
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Bytes/RawRepresentable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ extension IteratorProtocol where Element == Byte {
/// - Returns: A raw representable type as a fixed width integer of type `type`, or `nil` if the sequence is finished.
/// - Throws: `BytesError.invalidMemorySize` if a complete integer could not be returned by the time the sequence ended.
@inlinable
public mutating func nextIfPresent<T: RawRepresentable>(bigEndian type: T.Type) async throws -> T? where T.RawValue: FixedWidthInteger {
public mutating func nextIfPresent<T: RawRepresentable>(bigEndian type: T.Type) throws -> T? where T.RawValue: FixedWidthInteger {
try nextIfPresent(bytes: Bytes.self, count: MemoryLayout<T.RawValue>.size).map { try T(bigEndianBytes: $0) }
}
}
Expand Down

0 comments on commit 879f078

Please sign in to comment.