Skip to content

Commit

Permalink
Use static methods in uuid.Uuid (#2560)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperl authored Oct 4, 2024
1 parent 12dc62d commit 3da7ea3
Show file tree
Hide file tree
Showing 35 changed files with 7 additions and 199 deletions.
9 changes: 0 additions & 9 deletions external/gold/jaguar__src__jaguar.toit.gold

This file was deleted.

9 changes: 0 additions & 9 deletions external/gold/jaguar__src__network.toit.gold

This file was deleted.

9 changes: 0 additions & 9 deletions external/gold/jaguar__src__uart.toit.gold

This file was deleted.

4 changes: 2 additions & 2 deletions lib/ble/ble.toit
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class BleUuid:
else if data_ is string:
if data_.size != 4 and data_.size != 8 and data_.size != 36: throw "INVALID UUID"
if data_.size == 36:
uuid.parse data_ // This throws an exception if the format is incorrect.
uuid.Uuid.parse data_ // This throws an exception if the format is incorrect.
else:
if (catch: hex.decode data_):
throw "INVALID UUID $data_"
Expand Down Expand Up @@ -69,7 +69,7 @@ class BleUuid:
to-byte-array:
if data_ is string:
if data_.size <= 4: return hex.decode data_
return (uuid.parse data_).to-byte-array
return (uuid.Uuid.parse data_).to-byte-array
else:
return data_

Expand Down
2 changes: 1 addition & 1 deletion lib/device.toit
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ name -> string:
return hardware-id.stringify

/** Hardware ID of this device. */
hardware-id/uuid.Uuid ::= uuid.uuid5 "hw_id" get-mac-address_
hardware-id/uuid.Uuid ::= uuid.Uuid.uuid5 "hw_id" get-mac-address_

// --------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions tests/envelope/boot-container-source.toit
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ main:
else if install-run-image:
install-run install-run-image
else if run-image:
run (uuid.parse run-image)
run (uuid.Uuid.parse run-image)
else if remove-image:
containers.uninstall (uuid.parse remove-image)
containers.uninstall (uuid.Uuid.parse remove-image)
else:
throw "No action specified"
exit EXIT-CODE-STOP
Expand All @@ -61,7 +61,7 @@ install-run image-path:
reboot

if file.is-file uuid-path:
container-uuid := uuid.parse (file.read-content uuid-path).to-string
container-uuid := uuid.Uuid.parse (file.read-content uuid-path).to-string
run container-uuid
else:
// Install the image.
Expand Down
2 changes: 1 addition & 1 deletion tests/envelope/tar-test.toit
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ main args:
dir-stream := directory.DirectoryStream "$ota0/$image-dir"
file-name := dir-stream.next
// The files should be stored with their uuids.
uuid.parse file-name
uuid.Uuid.parse file-name
expect-null dir-stream.next
dir-stream.close

Expand Down
6 changes: 0 additions & 6 deletions tests/health/gold/sdk/examples__ble__advertise.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/examples__ble__connect.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/examples__ble__heart_rate.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/examples__ble__scan.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/lib__ble__ble.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/lib__ble__local.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/lib__ble__remote.toit.gold

This file was deleted.

3 changes: 0 additions & 3 deletions tests/health/gold/sdk/lib__device.toit.gold

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions tests/health/gold/sdk/tests__envelope__tar-test.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble1-board1.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble1-board2.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble1-shared.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble2-board1.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble2-board2.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble2-shared.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble2.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble3-board1.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble3-board2.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble3-shared.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble4-board1.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble4-board2.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble4-shared.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble5-board1.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble5-board2.toit.gold

This file was deleted.

6 changes: 0 additions & 6 deletions tests/health/gold/sdk/tests__esp32__ble5-shared.toit.gold

This file was deleted.

3 changes: 0 additions & 3 deletions tests/health/gold/sdk/tests__pi__spi.toit.gold

This file was deleted.

0 comments on commit 3da7ea3

Please sign in to comment.