Skip to content

Commit c39701f

Browse files
committed
Some documentation
And replace a force unwrap.
1 parent 4c58f23 commit c39701f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Sources/express/Express.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,13 @@ extension Express: CustomStringConvertible {
296296

297297
}
298298

299+
/**
300+
* If the done closure is called w/ arguments, the first one is considered
301+
* the error and the second one the result.
302+
*
303+
* I.e. to report an error: done(myError)
304+
* To report a result: done(nil, myValue)
305+
*/
299306
public typealias ExpressEngine = (
300307
_ path: String,
301308
_ options: Any?,

Sources/express/Mustache.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
22
// Mustache.swift
3-
// Noze.io / Macro
3+
// Noze.io / MacroExpress
44
//
55
// Created by Helge Heß on 02/06/16.
6-
// Copyright © 2016-2024 ZeeZide GmbH. All rights reserved.
6+
// Copyright © 2016-2025 ZeeZide GmbH. All rights reserved.
77
//
88

99
import func fs.readFile
@@ -14,8 +14,8 @@ import Mustache
1414

1515
let mustacheExpress : ExpressEngine = { path, options, done in
1616
fs.readFile(path, "utf8") { err, str in
17-
guard err == nil else {
18-
done(err!)
17+
if let error = err {
18+
done(err)
1919
return
2020
}
2121

0 commit comments

Comments
 (0)