mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: modernize-avoid-c-arrays (#44834)
use string_view for constants used in methods that take string_view args Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
@@ -49,10 +49,10 @@ namespace extensions {
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr char kCouldNotLoadFileError[] = "Could not load file: '*'.";
|
||||
constexpr char kDuplicateFileSpecifiedError[] =
|
||||
constexpr std::string_view kCouldNotLoadFileError = "Could not load file: '*'.";
|
||||
constexpr std::string_view kDuplicateFileSpecifiedError =
|
||||
"Duplicate file specified: '*'.";
|
||||
constexpr char kEmptyMatchesError[] =
|
||||
constexpr std::string_view kEmptyMatchesError =
|
||||
"Script with ID '*' must specify 'matches'.";
|
||||
constexpr char kExactlyOneOfCssAndFilesError[] =
|
||||
"Exactly one of 'css' and 'files' must be specified.";
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@@ -39,7 +40,7 @@ namespace extensions {
|
||||
|
||||
namespace tabs = api::tabs;
|
||||
|
||||
const char kFrameNotFoundError[] = "No frame with id * in tab *.";
|
||||
constexpr std::string_view kFrameNotFoundError = "No frame with id * in tab *.";
|
||||
const char kPerOriginOnlyInAutomaticError[] =
|
||||
"Can only set scope to "
|
||||
"\"per-origin\" in \"automatic\" mode.";
|
||||
|
||||
Reference in New Issue
Block a user