Jelajahi Sumber

readlink: Use StringView instead of const char*

Kenneth Myhra 3 tahun lalu
induk
melakukan
546a6a80a7
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      Userland/Utilities/readlink.cpp

+ 2 - 2
Userland/Utilities/readlink.cpp

@@ -14,14 +14,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
     TRY(Core::System::pledge("stdio rpath"));
     TRY(Core::System::pledge("stdio rpath"));
 
 
     bool no_newline = false;
     bool no_newline = false;
-    Vector<const char*> paths;
+    Vector<StringView> paths;
 
 
     Core::ArgsParser args_parser;
     Core::ArgsParser args_parser;
     args_parser.add_option(no_newline, "Do not append a newline", "no-newline", 'n');
     args_parser.add_option(no_newline, "Do not append a newline", "no-newline", 'n');
     args_parser.add_positional_argument(paths, "Symlink path", "path");
     args_parser.add_positional_argument(paths, "Symlink path", "path");
     args_parser.parse(arguments);
     args_parser.parse(arguments);
 
 
-    for (const char* path : paths) {
+    for (auto path : paths) {
         auto destination = TRY(Core::File::read_link(path));
         auto destination = TRY(Core::File::read_link(path));
         out("{}", destination);
         out("{}", destination);
         if (!no_newline)
         if (!no_newline)