style: cargo fmt
This commit is contained in:
@@ -97,7 +97,11 @@ fn render_module(graph: &CodeGraph) -> String {
|
||||
}
|
||||
|
||||
for (src, tgt) in graph.module_edges().keys() {
|
||||
lines.push(format!("{} -> {}", sanitize_identifier(src), sanitize_identifier(tgt)));
|
||||
lines.push(format!(
|
||||
"{} -> {}",
|
||||
sanitize_identifier(src),
|
||||
sanitize_identifier(tgt)
|
||||
));
|
||||
}
|
||||
|
||||
lines.join("\n")
|
||||
@@ -113,7 +117,11 @@ fn render_project(graph: &CodeGraph) -> String {
|
||||
let mod_id = sanitize_identifier(module);
|
||||
lines.push(format!("{mod_id}: {{"));
|
||||
for el in elements {
|
||||
lines.push(format!(" {}: {}", sanitize_identifier(el.name()), el.name()));
|
||||
lines.push(format!(
|
||||
" {}: {}",
|
||||
sanitize_identifier(el.name()),
|
||||
el.name()
|
||||
));
|
||||
}
|
||||
lines.push("}".to_string());
|
||||
}
|
||||
|
||||
@@ -2,9 +2,7 @@ use std::collections::HashMap;
|
||||
|
||||
use serde::Serialize;
|
||||
|
||||
use archlens_domain::{
|
||||
CodeGraph, DomainError, RenderOutput, RenderedFile, ports::DiagramRenderer,
|
||||
};
|
||||
use archlens_domain::{CodeGraph, DomainError, RenderOutput, RenderedFile, ports::DiagramRenderer};
|
||||
use archlens_rendering_primitives::non_import_rels;
|
||||
|
||||
pub struct HtmlRenderer;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
use archlens_domain::{
|
||||
Relationship, RelationshipKind,
|
||||
};
|
||||
use archlens_domain::{Relationship, RelationshipKind};
|
||||
use archlens_rendering_primitives::{non_import_rels, sanitize_identifier};
|
||||
|
||||
fn rel(src: &str, tgt: &str, kind: RelationshipKind) -> Relationship {
|
||||
@@ -16,7 +14,11 @@ fn non_import_rels_excludes_import_relationships() {
|
||||
];
|
||||
let filtered: Vec<_> = non_import_rels(&rels).collect();
|
||||
assert_eq!(filtered.len(), 2);
|
||||
assert!(filtered.iter().all(|r| r.kind() != RelationshipKind::Import));
|
||||
assert!(
|
||||
filtered
|
||||
.iter()
|
||||
.all(|r| r.kind() != RelationshipKind::Import)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -35,9 +35,7 @@ const RUST_PRIMITIVES: &[&str] = &[
|
||||
"Self",
|
||||
];
|
||||
|
||||
use archlens_domain::{
|
||||
CodeElement, CodeElementKind, Relationship, RelationshipKind, Visibility,
|
||||
};
|
||||
use archlens_domain::{CodeElement, CodeElementKind, Relationship, RelationshipKind, Visibility};
|
||||
|
||||
use crate::extraction_context::ExtractionContext;
|
||||
use crate::language_extractor::LanguageExtractor;
|
||||
|
||||
Reference in New Issue
Block a user