Skip to content

Commit

Permalink
Use empty options set
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewBarba committed Sep 13, 2023
1 parent dfe99c9 commit 56a0ba6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Compute/Fastly/FastlyCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ extension Fastly.Cache {

public static func lookup(_ key: String) throws -> Transaction {
var handle: WasiHandle = 0
let options = CacheLookupOptions.reserved
let options = CacheLookupOptions.none
var config = CacheLookupConfig()
try wasi(fastly_cache__cache_transaction_lookup(key, key.utf8.count, options.rawValue, &config, &handle))
return Transaction(handle)
Expand Down Expand Up @@ -120,7 +120,7 @@ extension Fastly.Cache {

public func getBody() throws -> Fastly.Body {
var bodyHandle: WasiHandle = 0
let options = CacheGetBodyOptions.reserved
let options = CacheGetBodyOptions.none
var config = CacheGetBodyConfig()
try wasi(fastly_cache__cache_get_body(handle, options.rawValue, &config, &bodyHandle))
return .init(bodyHandle)
Expand Down
8 changes: 8 additions & 0 deletions Sources/Compute/Fastly/FastlyTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ public struct CacheState: OptionSet {
public static let stale = CacheState(rawValue: 1 << 2)
public static let mustInsertOrUpdate = CacheState(rawValue: 1 << 3)

public static let none: CacheState = []

public let rawValue: UInt8
public init(rawValue: UInt8) {
self.rawValue = rawValue
Expand Down Expand Up @@ -437,6 +439,8 @@ public struct CacheWriteOptions: OptionSet, Sendable {
public static let userMetadata = CacheWriteOptions(rawValue: 1 << 7)
public static let sensitiveData = CacheWriteOptions(rawValue: 1 << 8)

public static let none: CacheWriteOptions = []

public let rawValue: UInt32
public init(rawValue: UInt32) {
self.rawValue = rawValue
Expand All @@ -447,6 +451,8 @@ public struct CacheLookupOptions: OptionSet, Sendable {
public static let reserved = CacheLookupOptions(rawValue: 1 << 0)
public static let requestHeaders = CacheLookupOptions(rawValue: 1 << 1)

public static let none: CacheLookupOptions = []

public let rawValue: UInt32
public init(rawValue: UInt32) {
self.rawValue = rawValue
Expand All @@ -458,6 +464,8 @@ public struct CacheGetBodyOptions: OptionSet, Sendable {
public static let from = CacheLookupOptions(rawValue: 1 << 1)
public static let to = CacheLookupOptions(rawValue: 1 << 2)

public static let none: CacheGetBodyOptions = []

public let rawValue: UInt32
public init(rawValue: UInt32) {
self.rawValue = rawValue
Expand Down

0 comments on commit 56a0ba6

Please sign in to comment.