Cache icon indicating copy to clipboard operation
Cache copied to clipboard

memoryConfig not optional for Storage.init as comment says.

Open martyu opened this issue 1 year ago • 1 comments
trafficstars

  ///
  /// - Parameters:
  ///   - diskConfig: Configuration for disk storage
  ///   - memoryConfig: *Optional*. Pass config if you want memory cache
  /// - Throws: Throw StorageError if any.
  public convenience init(diskConfig: DiskConfig, memoryConfig: MemoryConfig, transformer: Transformer<Value>) throws {
    let disk = try DiskStorage<Key, Value>(config: diskConfig, transformer: transformer)
    let memory = MemoryStorage<Key, Value>(config: memoryConfig)
    let hybridStorage = HybridStorage(memoryStorage: memory, diskStorage: disk)
    self.init(hybridStorage: hybridStorage)
  }

This says memoryConfig should be Optional, but it's not. Not sure which is the typo.

martyu avatar Jul 31 '24 19:07 martyu

The code should be the source of truth.

3lvis avatar Aug 04 '24 17:08 3lvis