Add tags to Rust std lib functions (#6701)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
@ -140,17 +140,19 @@ impl crate::docs::StdLibFn for MyFunc {
|
||||
false
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<String> {
|
||||
fn examples(&self) -> Vec<(String, bool)> {
|
||||
let code_blocks = vec!["This is another code block.\nyes sirrr.\nmyFunc"];
|
||||
let norun = vec![false];
|
||||
code_blocks
|
||||
.iter()
|
||||
.map(|cb| {
|
||||
.zip(norun)
|
||||
.map(|(cb, norun)| {
|
||||
let program = crate::Program::parse_no_errs(cb).unwrap();
|
||||
let mut options: crate::parsing::ast::types::FormatOptions = Default::default();
|
||||
options.insert_final_newline = false;
|
||||
program.ast.recast(&options, 0)
|
||||
(program.ast.recast(&options, 0), norun)
|
||||
})
|
||||
.collect::<Vec<String>>()
|
||||
.collect::<Vec<(String, bool)>>()
|
||||
}
|
||||
|
||||
fn std_lib_fn(&self) -> crate::std::StdFn {
|
||||
|
Reference in New Issue
Block a user