Skip to content

Commit abb1e79

Browse files
authored
Remove #![feature(crate_visibility_modifier)] (#197)
The documentation builder is an executable crate, so crate-level visibility doesn't add much.
1 parent 03e03e2 commit abb1e79

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

docs/src/main.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(crate_visibility_modifier)]
21
#![feature(proc_macro_hygiene)]
32

43
use comrak::{self, Arena, ComrakOptions};
@@ -15,6 +14,10 @@ use syntect::parsing::SyntaxSet;
1514
use syntect::highlighting::{Color, ThemeSet};
1615
use syntect::html::highlighted_html_for_string;
1716

17+
use crate::page::Page;
18+
use crate::string_writer::StringWriter;
19+
20+
mod page;
1821
mod string_writer;
1922
mod views;
2023

@@ -86,11 +89,6 @@ fn build_page(
8689
Ok(())
8790
}
8891

89-
struct Page<'a> {
90-
title: Option<&'a AstNode<'a>>,
91-
content: &'a AstNode<'a>,
92-
}
93-
9492
fn load_page<'a>(
9593
arena: &'a Arena<AstNode<'a>>,
9694
options: &ComrakOptions,
@@ -118,7 +116,7 @@ fn load_page_title<'a>(
118116
comrak::format_commonmark(
119117
title,
120118
options,
121-
&mut string_writer::StringWriter(&mut buffer),
119+
&mut StringWriter(&mut buffer),
122120
).unwrap();
123121
buffer
124122
});

docs/src/page.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
use comrak::nodes::AstNode;
2+
3+
pub struct Page<'a> {
4+
pub title: Option<&'a AstNode<'a>>,
5+
pub content: &'a AstNode<'a>,
6+
}
7+

docs/src/views.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl<'a> Render for ComrakText<'a> {
3434
}
3535
}
3636

37-
crate fn main<'a>(
37+
pub fn main<'a>(
3838
options: &'a ComrakOptions,
3939
slug: &str,
4040
page: Page<'a>,

0 commit comments

Comments
 (0)