From 4a6c59d519394549d305d8ec69500733d7e4beed Mon Sep 17 00:00:00 2001 From: apio Date: Fri, 16 Dec 2022 19:48:22 +0100 Subject: [PATCH] Make all methods in OwnedStringView const --- luna/include/luna/OwnedStringView.h | 6 +++--- luna/src/OwnedStringView.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/luna/include/luna/OwnedStringView.h b/luna/include/luna/OwnedStringView.h index 4dd59332..50e208b3 100644 --- a/luna/include/luna/OwnedStringView.h +++ b/luna/include/luna/OwnedStringView.h @@ -9,14 +9,14 @@ class OwnedStringView OwnedStringView(const OwnedStringView&) = delete; ~OwnedStringView(); - Result clone(); + Result clone() const; - const char* chars() + const char* chars() const { return m_string; } - usize length() + usize length() const { return m_length; } diff --git a/luna/src/OwnedStringView.cpp b/luna/src/OwnedStringView.cpp index d81a30cf..1bf1b4ec 100644 --- a/luna/src/OwnedStringView.cpp +++ b/luna/src/OwnedStringView.cpp @@ -26,7 +26,7 @@ OwnedStringView::~OwnedStringView() if (m_string) destroy_array(m_string); } -Result OwnedStringView::clone() +Result OwnedStringView::clone() const { char* buf = TRY(make_array(m_length + 1));