Skip to content

Commit b83af7d

Browse files
committed
update cow box properties
1 parent a59fea0 commit b83af7d

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

Samples/AnimalsData/Sources/AnimalsData/Animal.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
import CowBox
1818

1919
@CowBox(init: .withPackage) public struct Animal: Hashable, Codable, Sendable {
20-
public let animalId: String
21-
public let name: String
22-
public let diet: Diet
23-
public let categoryId: String
20+
@CowBoxNonMutating public var animalId: String
21+
@CowBoxNonMutating public var name: String
22+
@CowBoxNonMutating public var diet: Diet
23+
@CowBoxNonMutating public var categoryId: String
2424
}
2525

2626
extension Animal {

Samples/AnimalsData/Sources/AnimalsData/AnimalsState.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import CowBox
1919
import Foundation
2020

2121
@CowBox(init: .withPackage) public struct AnimalsState: Hashable, Sendable {
22-
package var categories: Categories
23-
package var animals: Animals
22+
@CowBoxMutating package var categories: Categories
23+
@CowBoxMutating package var animals: Animals
2424
}
2525

2626
extension AnimalsState {
@@ -34,16 +34,16 @@ extension AnimalsState {
3434

3535
extension AnimalsState {
3636
@CowBox(init: .withPackage) package struct Categories: Hashable, Sendable {
37-
package var data: TreeDictionary<Category.ID, Category> = [:]
38-
package var status: Status? = nil
37+
@CowBoxMutating package var data: TreeDictionary<Category.ID, Category> = [:]
38+
@CowBoxMutating package var status: Status? = nil
3939
}
4040
}
4141

4242
extension AnimalsState {
4343
@CowBox(init: .withPackage) package struct Animals: Hashable, Sendable {
44-
package var data: TreeDictionary<Animal.ID, Animal> = [:]
45-
package var status: Status? = nil
46-
package var queue: TreeDictionary<Animal.ID, Status> = [:]
44+
@CowBoxMutating package var data: TreeDictionary<Animal.ID, Animal> = [:]
45+
@CowBoxMutating package var status: Status? = nil
46+
@CowBoxMutating package var queue: TreeDictionary<Animal.ID, Status> = [:]
4747
}
4848
}
4949

Samples/AnimalsData/Sources/AnimalsData/Category.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
import CowBox
1818

1919
@CowBox(init: .withPackage) public struct Category: Hashable, Codable, Sendable {
20-
public let categoryId: String
21-
public let name: String
20+
@CowBoxNonMutating public var categoryId: String
21+
@CowBoxNonMutating public var name: String
2222
}
2323

2424
extension Category: Identifiable {

Samples/QuakesData/Sources/QuakesData/Quake.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ import CowBox
1818
import Foundation
1919

2020
@CowBox(init: .withPackage) public struct Quake: Hashable, Sendable {
21-
public let quakeId: String
22-
public let magnitude: Double
23-
public let time: Date
24-
public let updated: Date
25-
public let name: String
26-
public let longitude: Double
27-
public let latitude: Double
21+
@CowBoxNonMutating public var quakeId: String
22+
@CowBoxNonMutating public var magnitude: Double
23+
@CowBoxNonMutating public var time: Date
24+
@CowBoxNonMutating public var updated: Date
25+
@CowBoxNonMutating public var name: String
26+
@CowBoxNonMutating public var longitude: Double
27+
@CowBoxNonMutating public var latitude: Double
2828
}
2929

3030
extension Quake: Identifiable {

Samples/QuakesData/Sources/QuakesData/QuakesState.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import CowBox
1919
import Foundation
2020

2121
@CowBox(init: .withPackage) public struct QuakesState: Hashable, Sendable {
22-
package var quakes: Quakes
22+
@CowBoxMutating package var quakes: Quakes
2323
}
2424

2525
extension QuakesState {
@@ -32,8 +32,8 @@ extension QuakesState {
3232

3333
extension QuakesState {
3434
@CowBox(init: .withPackage) package struct Quakes: Hashable, Sendable {
35-
package var data: TreeDictionary<Quake.ID, Quake> = [:]
36-
package var status: Status? = nil
35+
@CowBoxMutating package var data: TreeDictionary<Quake.ID, Quake> = [:]
36+
@CowBoxMutating package var status: Status? = nil
3737
}
3838
}
3939

0 commit comments

Comments
 (0)