Skip to content

Commit

Permalink
Make DocumentReader internal
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianfett committed Jul 22, 2020
1 parent 4d3b7a9 commit 951a0d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/PureSwiftJSON/Parsing/DocumentReader.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

public struct DocumentReader {
@usableFromInline struct DocumentReader {
@usableFromInline let array: [UInt8]
@usableFromInline let count: Int

@usableFromInline /* private(set) */ var index: Int = -1
@usableFromInline /* private(set) */ var value: UInt8?

@inlinable public init<Bytes: Collection>(bytes: Bytes) where Bytes.Element == UInt8 {
@inlinable init<Bytes: Collection>(bytes: Bytes) where Bytes.Element == UInt8 {
if let array = bytes as? [UInt8] {
self.array = array
} else {
Expand All @@ -20,7 +20,7 @@ public struct DocumentReader {
return array[bounds]
}

@inlinable public mutating func read() -> (UInt8, Int)? {
@inlinable mutating func read() -> (UInt8, Int)? {
guard index < count - 1 else {
value = nil
index = array.endIndex
Expand Down

0 comments on commit 951a0d3

Please sign in to comment.