Skip to content

Commit

Permalink
Format PR 1437 with clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Feb 9, 2025
1 parent a8582e9 commit 1484582
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions include/cxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ class String final {
String(const char16_t *);
String(const char16_t *, std::size_t);
#if __cplusplus >= 202002L
String(const char8_t *s) : String(reinterpret_cast<const char*>(s)) {}
String(const char8_t *s, std::size_t len) : String(reinterpret_cast<const char*>(s), len) {}
String(const char8_t *s) : String(reinterpret_cast<const char *>(s)) {}
String(const char8_t *s, std::size_t len)
: String(reinterpret_cast<const char *>(s), len) {}
#endif

// Replace invalid Unicode data with the replacement character (U+FFFD).
Expand Down
3 changes: 2 additions & 1 deletion tests/ffi/tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,8 @@ extern "C" const char *cxx_run_test() noexcept {
ASSERT(cstr == "foo");
ASSERT(other_cstr == "test");

// u8"foo" is `const char*` before, and `const char8_t*` after C++20, so using `auto`.
// u8"foo" is `const char*` before, and `const char8_t*` after C++20, so using
// `auto`.
const auto *utf8_literal = u8"Test string";
const char16_t *utf16_literal = u"Test string";
rust::String utf8_rstring = utf8_literal;
Expand Down

0 comments on commit 1484582

Please sign in to comment.