Skip to content

Commit 6c7beb5

Browse files
committed
use string_view
1 parent 528b9da commit 6c7beb5

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

.vscode/tasks.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,14 @@
7979
{
8080
"label": "format",
8181
"type": "shell",
82-
"command": "make apply-format",
82+
"command": "make format",
83+
"problemMatcher": [],
84+
"group": "build"
85+
},
86+
{
87+
"label": "lint",
88+
"type": "shell",
89+
"command": "make config=lint && make config=lint test",
8390
"problemMatcher": [],
8491
"group": "build"
8592
}

src/tml/tree.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ forest tml::read(const papki::file& fi)
7777
return std::move(listener.cur_forest);
7878
}
7979

80-
forest tml::read(const std::string& str)
80+
forest tml::read(std::string_view str)
8181
{
8282
const papki::span_file fi(to_uint8_t(utki::make_span(str)));
8383

src/tml/tree.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,18 @@ using tree = utki::tree<leaf>;
203203
using forest = tree::container_type;
204204

205205
forest read(const papki::file& fi);
206-
forest read(const std::string& str);
206+
forest read(std::string_view str);
207207

208208
enum class formatting {
209209
normal,
210210
minimal
211211
};
212212

213-
void write(const forest& wood, papki::file& fi, formatting fmt = formatting::normal);
213+
void write(
214+
const forest& wood, //
215+
papki::file& fi,
216+
formatting fmt = formatting::normal
217+
);
214218

215219
std::string to_string(const forest& f);
216220

0 commit comments

Comments
 (0)