style: auto-format example files with lux fmt
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,15 +1,3 @@
|
||||
// Demonstrating Schema Evolution in Lux
|
||||
//
|
||||
// Lux provides versioned types to help manage data evolution over time.
|
||||
// The Schema module provides functions for creating and migrating versioned values.
|
||||
//
|
||||
// Expected output:
|
||||
// Created user v1: Alice (age unknown)
|
||||
// User version: 1
|
||||
// Migrated to v2: Alice (age unknown)
|
||||
// User version after migration: 2
|
||||
|
||||
// Create a versioned User value at v1
|
||||
fn createUserV1(name: String): Unit with {Console} = {
|
||||
let user = Schema.versioned("User", 1, { name: name })
|
||||
let version = Schema.getVersion(user)
|
||||
@@ -17,7 +5,6 @@ fn createUserV1(name: String): Unit with {Console} = {
|
||||
Console.print("User version: " + toString(version))
|
||||
}
|
||||
|
||||
// Migrate a user to v2
|
||||
fn migrateUserToV2(name: String): Unit with {Console} = {
|
||||
let userV1 = Schema.versioned("User", 1, { name: name })
|
||||
let userV2 = Schema.migrate(userV1, 2)
|
||||
@@ -26,7 +13,6 @@ fn migrateUserToV2(name: String): Unit with {Console} = {
|
||||
Console.print("User version after migration: " + toString(newVersion))
|
||||
}
|
||||
|
||||
// Main
|
||||
fn main(): Unit with {Console} = {
|
||||
createUserV1("Alice")
|
||||
migrateUserToV2("Alice")
|
||||
|
||||
Reference in New Issue
Block a user