From bc9ee72648010b1c02295907e356f07856b1e85f Mon Sep 17 00:00:00 2001 From: mcmah309 Date: Mon, 9 Dec 2024 19:50:38 +0000 Subject: [PATCH] feat: Update --- book/src/libs/env/env.md | 2 +- lib/src/cell/once_cell/once_cell.dart | 4 ++-- lib/src/cell/once_cell/once_cell_nullable.dart | 4 ++-- lib/src/env/vm.dart | 2 +- lib/src/env/web.dart | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/book/src/libs/env/env.md b/book/src/libs/env/env.md index 52d8eb7..283866a 100644 --- a/book/src/libs/env/env.md +++ b/book/src/libs/env/env.md @@ -9,7 +9,7 @@ void main(){ print("On web, doing nothing."); } else if(Env.isLinux || Env.isMacOs) { - Env.setCurrentDirectory = "/"; + Env.currentDirectory = "/"; print("Moved current directory to root"); } ... diff --git a/lib/src/cell/once_cell/once_cell.dart b/lib/src/cell/once_cell/once_cell.dart index 7079135..5546859 100644 --- a/lib/src/cell/once_cell/once_cell.dart +++ b/lib/src/cell/once_cell/once_cell.dart @@ -101,7 +101,7 @@ class OnceCell implements OnceCellNullable { @override String toString() { return (_val == null - ? "Uninitialized $runtimeType" - : "Initialized $runtimeType($_val)"); + ? "$runtimeType" + : "$runtimeType($_val)"); } } diff --git a/lib/src/cell/once_cell/once_cell_nullable.dart b/lib/src/cell/once_cell/once_cell_nullable.dart index 4ca4453..f6de822 100644 --- a/lib/src/cell/once_cell/once_cell_nullable.dart +++ b/lib/src/cell/once_cell/once_cell_nullable.dart @@ -123,7 +123,7 @@ class OnceCellNullable { @override String toString() { return (_isSet - ? "Initialized $runtimeType($_val)" - : "Uninitialized $runtimeType"); + ? "$runtimeType($_val)" + : "$runtimeType"); } } diff --git a/lib/src/env/vm.dart b/lib/src/env/vm.dart index 6300d6f..c426847 100644 --- a/lib/src/env/vm.dart +++ b/lib/src/env/vm.dart @@ -5,7 +5,7 @@ import 'package:rust/rust.dart'; class Env { static Path get currentDirectory => Path(Directory.current.path); - static set setCurrentDirectory(Path path) => + static set currentDirectory(Path path) => Directory.current = path.asString(); /// joins a collection of Paths appropriately for the PATH environment variable. diff --git a/lib/src/env/web.dart b/lib/src/env/web.dart index 6d32109..438320b 100644 --- a/lib/src/env/web.dart +++ b/lib/src/env/web.dart @@ -5,7 +5,7 @@ class Env { static Path get currentDirectory => throw UnsupportedError( "'currentDirectory' is not supported on on this platform"); - static set setCurrentDirectory(Path path) => throw UnsupportedError( + static set currentDirectory(Path path) => throw UnsupportedError( "'setCurrentDirectory' is not supported on on this platform"); static String joinPaths(Iterable paths) => throw UnsupportedError(