Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memoryConfig not optional for Storage.init as comment says. #330

Open
martyu opened this issue Jul 31, 2024 · 1 comment
Open

memoryConfig not optional for Storage.init as comment says. #330

martyu opened this issue Jul 31, 2024 · 1 comment

Comments

@martyu
Copy link

martyu commented Jul 31, 2024

  ///
  /// - 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.

@3lvis
Copy link
Collaborator

3lvis commented Aug 4, 2024

The code should be the source of truth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants