From b0ffb15e13e1bef18f986c20cdd87bf122c4a1b7 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 10 Mar 2023 15:43:25 +0000 Subject: [PATCH] copy: Stop using DeprecatedString --- Userland/Utilities/copy.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Userland/Utilities/copy.cpp b/Userland/Utilities/copy.cpp index e054de77f0..96da954496 100644 --- a/Userland/Utilities/copy.cpp +++ b/Userland/Utilities/copy.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include @@ -16,7 +16,7 @@ #include struct Options { - DeprecatedString data; + String data; StringView type; bool clear; }; @@ -24,7 +24,7 @@ struct Options { static ErrorOr parse_options(Main::Arguments arguments) { auto type = "text/plain"sv; - Vector text; + Vector text; bool clear = false; Core::ArgsParser args_parser; @@ -46,12 +46,12 @@ static ErrorOr parse_options(Main::Arguments arguments) auto buffer = TRY(c_stdin->read_until_eof()); dbgln("Read size {}", buffer.size()); dbgln("Read data: `{}`", StringView(buffer.bytes())); - options.data = buffer.bytes(); + options.data = TRY(String::from_utf8(StringView(buffer.bytes()))); } else { // Copy the rest of our command-line args. StringBuilder builder; builder.join(' ', text); - options.data = builder.to_deprecated_string(); + options.data = TRY(builder.to_string()); } return options;