diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-12-22 14:27:36 +0000 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2023-02-03 07:19:52 -0500 |
commit | 609a123c43f8aedd451af4a8b9adf0f93834e805 (patch) | |
tree | 6905c73a996e3d8e8d5fe1a22f63a1094769bf99 /Userland/Utilities | |
parent | d4f0cfec7f65a62bf780fe9b5833600f3cc8a745 (diff) | |
download | serenity-609a123c43f8aedd451af4a8b9adf0f93834e805.zip |
Utilities/df: Replace uses of JsonObject::get_deprecated()/get_ptr()
Diffstat (limited to 'Userland/Utilities')
-rw-r--r-- | Userland/Utilities/df.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Utilities/df.cpp b/Userland/Utilities/df.cpp index 51f5813454..a80945aa81 100644 --- a/Userland/Utilities/df.cpp +++ b/Userland/Utilities/df.cpp @@ -62,15 +62,15 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto const& json = json_result.as_array(); json.for_each([&](auto& value) { auto& fs_object = value.as_object(); - auto fs = fs_object.get_deprecated("class_name"sv).to_deprecated_string(); - auto total_block_count = fs_object.get_deprecated("total_block_count"sv).to_u64(); - auto free_block_count = fs_object.get_deprecated("free_block_count"sv).to_u64(); + auto fs = fs_object.get_deprecated_string("class_name"sv).value_or({}); + auto total_block_count = fs_object.get_u64("total_block_count"sv).value_or(0); + auto free_block_count = fs_object.get_u64("free_block_count"sv).value_or(0); auto used_block_count = total_block_count - free_block_count; - auto total_inode_count = fs_object.get_deprecated("total_inode_count"sv).to_u64(); - auto free_inode_count = fs_object.get_deprecated("free_inode_count"sv).to_u64(); + auto total_inode_count = fs_object.get_u64("total_inode_count"sv).value_or(0); + auto free_inode_count = fs_object.get_u64("free_inode_count"sv).value_or(0); auto used_inode_count = total_inode_count - free_inode_count; - auto block_size = fs_object.get_deprecated("block_size"sv).to_u64(); - auto mount_point = fs_object.get_deprecated("mount_point"sv).to_deprecated_string(); + auto block_size = fs_object.get_u64("block_size"sv).value_or(0); + auto mount_point = fs_object.get_deprecated_string("mount_point"sv).value_or({}); auto used_percentage = 100; if (total_block_count != 0) |