Skip to content

Commit

Permalink
clippy&fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jdonszelmann committed Jun 5, 2024
1 parent b27e43c commit 7dce6de
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
20 changes: 13 additions & 7 deletions scopegraphs-render-docs/src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,12 @@ fn split_attr_body(ident: &Ident, input: &str, loc: &mut Location) -> Vec<Attr>
let mut ctx: Ctx<'_> = Default::default();

let flush_buffer_as_doc_comment = |ctx: &mut Ctx| {
// if !ctx.buffer.is_empty() {
ctx.attrs.push(Attr::DocComment(
ident.clone(),
ctx.buffer.drain(..).join(" "),
));
// }
if !ctx.buffer.is_empty() {
ctx.attrs.push(Attr::DocComment(
ident.clone(),
ctx.buffer.drain(..).join(" "),
));
}
};

let flush_buffer_as_diagram_entry = |ctx: &mut Ctx| {
Expand Down Expand Up @@ -684,6 +684,9 @@ mod tests {
fn check(case: TestCase) {
let mut loc = case.location;
let attrs = split_attr_body(&case.ident, case.input, &mut loc);
println!("{attrs:?}");
println!("---");
println!("{:?}", case.expect_attrs);
assert_eq!(loc, case.expect_location);
assert_eq!(attrs, case.expect_attrs);
}
Expand Down Expand Up @@ -785,7 +788,10 @@ mod tests {
location: Location::InsideDiagram,
input: "```",
expect_location: Location::OutsideDiagram,
expect_attrs: vec![Attr::DiagramEnd(i())],
expect_attrs: vec![
Attr::DiagramEntry(i(), "".to_string()),
Attr::DiagramEnd(i()),
],
};

check(case)
Expand Down
1 change: 1 addition & 0 deletions scopegraphs/src/concepts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ pub mod scope_data {}

#[render_scopegraphs]
/// Edges connect [`Scopes`](crate::concepts::scope) together, based on the rules of the language you're trying to create.
///
/// By adding edges, you're really starting to use scope graphs.
///
/// You can think of edges as the path a name resolution can take. Edges are always directed.
Expand Down

0 comments on commit 7dce6de

Please sign in to comment.