From 609a123c43f8aedd451af4a8b9adf0f93834e805 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 22 Dec 2022 14:27:36 +0000 Subject: Utilities/df: Replace uses of JsonObject::get_deprecated()/get_ptr() --- Userland/Utilities/df.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Userland/Utilities') 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 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) -- cgit v1.2.3