@@ -50,7 +50,7 @@ void generate_record_overview(HtmlWriter::OpenDiv& record_div,
50
50
{
51
51
// TODO: This code gets duplicated a lot, share it.
52
52
53
- for (const Namespace & n : element.namespace_path .iter ().rev ()) {
53
+ for (const Namespace& n : element.namespace_path .iter ().rev ()) {
54
54
switch (n) {
55
55
case Namespace::Tag::Global: break ;
56
56
case Namespace::Tag::Anonymous: {
@@ -68,7 +68,7 @@ void generate_record_overview(HtmlWriter::OpenDiv& record_div,
68
68
break ;
69
69
}
70
70
}
71
- for (std::string_view record_name: element.record_path .iter ().rev ()) {
71
+ for (std::string_view record_name : element.record_path .iter ().rev ()) {
72
72
{
73
73
auto record_anchor = full_type_span.open_a ();
74
74
record_anchor.write_text (record_name);
@@ -157,10 +157,11 @@ void generate_record_fields(HtmlWriter::OpenDiv& record_div,
157
157
field_type_link.add_title (fe.type_name );
158
158
if (fe.type_element .is_some ()) {
159
159
field_type_link.add_href (
160
- construct_html_file_path (std::filesystem::path (),
161
- fe.type_element ->namespace_path .as_ref (),
162
- fe.type_element ->record_path .as_ref (),
163
- fe.type_element ->name )
160
+ construct_html_file_path (
161
+ std::filesystem::path (),
162
+ fe.type_element ->namespace_path .as_slice (),
163
+ fe.type_element ->record_path .as_slice (),
164
+ fe.type_element ->name )
164
165
.string ());
165
166
}
166
167
field_type_link.write_text (fe.short_type_name );
@@ -221,14 +222,14 @@ void generate_record_methods(HtmlWriter::OpenDiv& record_div,
221
222
void generate_record (const RecordElement& element,
222
223
const Options& options) noexcept {
223
224
const std::filesystem::path path = construct_html_file_path (
224
- options.output_root , element.namespace_path .as_ref (),
225
- element.record_path .as_ref (), element.name );
225
+ options.output_root , element.namespace_path .as_slice (),
226
+ element.record_path .as_slice (), element.name );
226
227
std::filesystem::create_directories (path.parent_path ());
227
228
auto html = HtmlWriter (open_file_for_writing (path).unwrap ());
228
229
229
230
{
230
231
std::ostringstream title;
231
- for (const Namespace& n: element.namespace_path .iter ().rev ()) {
232
+ for (const Namespace& n : element.namespace_path .iter ().rev ()) {
232
233
switch (n) {
233
234
case Namespace::Tag::Global: break ;
234
235
case Namespace::Tag::Anonymous:
@@ -241,7 +242,7 @@ void generate_record(const RecordElement& element,
241
242
break ;
242
243
}
243
244
}
244
- for (std::string_view record_name: element.record_path .iter ().rev ()) {
245
+ for (std::string_view record_name : element.record_path .iter ().rev ()) {
245
246
title << record_name;
246
247
title << " ::" ;
247
248
}
@@ -285,9 +286,9 @@ void generate_record(const RecordElement& element,
285
286
});
286
287
287
288
generate_record_fields (mref (record_div), element, true ,
288
- sorted_static_fields.as_ref ());
289
+ sorted_static_fields.as_slice ());
289
290
generate_record_fields (mref (record_div), element, false ,
290
- sorted_fields.as_ref ());
291
+ sorted_fields.as_slice ());
291
292
292
293
sus::Vec<SortedFunctionByName> sorted_static_methods;
293
294
sus::Vec<SortedFunctionByName> sorted_methods;
@@ -314,9 +315,9 @@ void generate_record(const RecordElement& element,
314
315
});
315
316
316
317
generate_record_methods (mref (record_div), element, true ,
317
- sorted_static_methods.as_ref ());
318
+ sorted_static_methods.as_slice ());
318
319
generate_record_methods (mref (record_div), element, false ,
319
- sorted_methods.as_ref ());
320
+ sorted_methods.as_slice ());
320
321
321
322
for (const auto & [key, subrecord] : element.records ) {
322
323
generate_record (subrecord, options);
@@ -344,8 +345,8 @@ void generate_record_reference(HtmlWriter::OpenDiv& section_div,
344
345
name_link.add_class (" type-name" );
345
346
name_link.add_href (
346
347
construct_html_file_path (std::filesystem::path (),
347
- element.namespace_path .as_ref (),
348
- element.record_path .as_ref (), element.name )
348
+ element.namespace_path .as_slice (),
349
+ element.record_path .as_slice (), element.name )
349
350
.string ());
350
351
name_link.write_text (element.name );
351
352
}
0 commit comments