Skip to content

Commit 0353f62

Browse files
Fixed some documentation and code spelling mistakes
1 parent bb359d0 commit 0353f62

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

Sources/CodableDatastore/CodableDatastore.docc/Conceptual/On Disk Representation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ The four common database operations are outlined below:
326326
15. The `Dirty` file is removed for the snapshot.
327327

328328
The above is performed for a single transaction, so multiple updates can take
329-
advantage of this and be written at the same time. Updated made without
329+
advantage of this and be written at the same time. Updates made without
330330
a transaction are performed within one automatically, though these edits may
331331
be coalesced if they happen between writes to disk from multiple sources.
332332

Sources/CodableDatastore/CodableDatastore.docc/Conceptual/Persisting History.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ are themselves copied from backups, making sure that they don't inadvertedly
2727
change.
2828

2929
Backups utilize file-system block sharing when available, such as on APFS, and
30-
as such should be a relatively cheap operating to complete.
30+
as such should be a relatively cheap operation to complete.
3131

3232
### Snapshots
3333

Sources/CodableDatastore/Persistence/Disk Persistence/Datastore/PersistenceDatastore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ extension DiskPersistence {
5555
// MARK: - Common URL Accessors
5656

5757
extension DiskPersistence.Datastore {
58-
/// The URL that points to the Snapshot directory.
58+
/// The URL that points to the Datastore directory.
5959
nonisolated var datastoreURL: URL {
6060
snapshot
6161
.datastoresURL

Sources/CodableDatastore/Persistence/Disk Persistence/DiskPersistence.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public actor DiskPersistence<AccessMode: _AccessMode>: Persistence {
9696
}
9797

9898
// MARK: - Default Store
99+
99100
extension DiskPersistence where AccessMode == ReadWrite {
100101
/// The default persistence for the read-write store of an app.
101102
public static func defaultStore() throws -> DiskPersistence<AccessMode> {
@@ -116,6 +117,7 @@ extension DiskPersistence where AccessMode == ReadOnly {
116117
}
117118

118119
// MARK: - Common URL Accessors
120+
119121
extension DiskPersistence {
120122
/// The URL that points to the Snapshots directory.
121123
nonisolated var snapshotsURL: URL {
@@ -134,6 +136,7 @@ extension DiskPersistence {
134136
}
135137

136138
// MARK: - Store Info
139+
137140
extension DiskPersistence {
138141
/// Load the store info from disk, or create a suitable starting value if such a file does not exist.
139142
private func loadStoreInfo() throws -> StoreInfo {
@@ -278,6 +281,7 @@ extension DiskPersistence {
278281
}
279282

280283
// MARK: - Snapshot Management
284+
281285
extension DiskPersistence {
282286
/// Load the default snapshot from disk, or create an empty one if such a file does not exist.
283287
private func loadSnapshot(from storeInfo: StoreInfo) -> Snapshot<AccessMode> {
@@ -376,7 +380,8 @@ extension DiskPersistence {
376380
}
377381
}
378382

379-
// MARK: - Persisitence Creation
383+
// MARK: - Persistence Creation
384+
380385
extension DiskPersistence where AccessMode == ReadWrite {
381386
/// Create directories for our persistence.
382387
private func createPersistenceDirectories() throws {
@@ -427,7 +432,7 @@ extension DiskPersistence {
427432
}
428433

429434
if Access.self == ReadWrite.self, weakDatastore.canWrite {
430-
assertionFailure("An existing datastore that can write to the persistence has already been registered for this key. Only one writer is suppored per key. This will throw an error on release builds.")
435+
assertionFailure("An existing datastore that can write to the persistence has already been registered for this key. Only one writer is supported per key. This will throw an error on release builds.")
431436
throw DatastoreInterfaceError.duplicateWriters
432437
}
433438
}

Sources/CodableDatastore/Persistence/Disk Persistence/Snapshot/Snapshot.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ actor Snapshot<AccessMode: _AccessMode> {
2424

2525
/// A flag indicating if this is a backup snapshot.
2626
///
27-
/// This is used to determine where on disk the snapshot is stored.
27+
/// This is used to determine which parent directory on disk the snapshot is stored.
2828
let isBackup: Bool
2929

3030
/// A cached instance of the manifest as last loaded from disk.

Sources/CodableDatastore/Persistence/Disk Persistence/Snapshot/SnapshotIteration.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ extension SnapshotIteration {
6868
}
6969

7070
extension SnapshotIteration {
71+
/// Internal method to check if an instance should be persisted based on iff it changed significantly from a previous iteration
72+
/// - Parameter existingInstance: The previous iteration to check
73+
/// - Returns: `true` if the iteration should be persisted, `false` if it represents the same data from `existingInstance`.
7174
func isMeaningfullyChanged(from existingInstance: Self?) -> Bool {
7275
guard
7376
dataStores == existingInstance?.dataStores

0 commit comments

Comments
 (0)