@@ -20,7 +20,6 @@ public actor DefaultLeafCache: LeafCache {
2020
2121 /// - Parameters:
2222 /// - document: The `LeafAST` to store
23- /// - loop: `EventLoop` to return futures on
2423 /// - replace: If a document with the same name is already cached, whether to replace or not.
2524 /// - Returns: The document provided as an identity return
2625 public func insert( _ document: LeafAST , replace: Bool = false ) async throws -> LeafAST {
@@ -32,7 +31,7 @@ public actor DefaultLeafCache: LeafCache {
3231 // return an error if replace is false and the document name is already in cache
3332 switch ( self . cache. keys. contains ( document. name) , replace) {
3433 case ( true , false ) :
35- throw LeafError ( . keyExists( document. name) )
34+ throw LeafError . keyExists ( document. name)
3635 default :
3736 self . cache [ document. name] = document
3837 }
@@ -41,8 +40,7 @@ public actor DefaultLeafCache: LeafCache {
4140
4241 /// - Parameters:
4342 /// - documentName: Name of the `LeafAST` to try to return
44- /// - loop: `EventLoop` to return futures on
45- /// - Returns: `EventLoopFuture<LeafAST?>` holding the `LeafAST` or nil if no matching result
43+ /// - Returns: ``LeafAST` or nil if no matching result
4644 public func retrieve( documentName: String ) async throws -> LeafAST ? {
4745 guard self . isEnabled else {
4846 return nil
@@ -52,12 +50,11 @@ public actor DefaultLeafCache: LeafCache {
5250
5351 /// - Parameters:
5452 /// - documentName: Name of the `LeafAST` to try to purge from the cache
55- /// - loop: `EventLoop` to return futures on
56- /// - Returns: `EventLoopFuture<Bool?>` - If no document exists, returns nil. If removed,
53+ /// - Returns: If no document exists, returns nil. If removed,
5754 /// returns true. If cache can't remove because of dependencies (not yet possible), returns false.
5855 public func remove( _ documentName: String ) async throws -> Bool ? {
5956 guard self . isEnabled else {
60- throw LeafError ( . cachingDisabled)
57+ throw LeafError . cachingDisabled ( )
6158 }
6259
6360 guard self . cache [ documentName] != nil else {
@@ -73,10 +70,10 @@ public actor DefaultLeafCache: LeafCache {
7370 /// Blocking file load behavior
7471 func retrieve( documentName: String ) throws -> LeafAST ? {
7572 guard self . isEnabled else {
76- throw LeafError ( . cachingDisabled)
73+ throw LeafError . cachingDisabled ( )
7774 }
7875 guard let result = self . cache [ documentName] else {
79- throw LeafError ( . noValueForKey( documentName) )
76+ throw LeafError . noValueForKey ( documentName)
8077 }
8178 return result
8279 }
0 commit comments