Skip to content

Commit 7634e82

Browse files
committed
Auto merge of #76804 - tmandry:rollup-nwntt3q, r=tmandry
Rollup of 16 pull requests Successful merges: - #75026 (Add array_windows fn) - #76642 (Do not lint ignored private doc tests) - #76719 (Change error message for ty param in const) - #76721 (Use intra-doc links in `core::mem`) - #76728 (Add a comment why `extern crate` is necessary for rustdoc) - #76735 (Remove unnecessary `clone()`s in bootstrap) - #76741 (Avoid printing dry run timings) - #76747 (Add missing code examples in libcore) - #76756 (fix a couple of stylistic clippy warnings) - #76758 ([fuchsia] Propagate the userspace UTC clock) - #76759 (Fix stabilization marker for future_readiness_fns) - #76760 (don't lazily evaluate some trivial values for Option::None replacements (clippy::unnecessary_lazy_evaluations)) - #76764 (Update books) - #76775 (Strip a single leading tab when rendering dataflow diffs) - #76778 (Simplify iter fuse struct doc) - #76794 (Make graphviz font configurable) Failed merges: r? `@ghost`
2 parents 3ce368d + 1a3cd78 commit 7634e82

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/lib.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -591,14 +591,14 @@ pub trait GraphWalk<'a> {
591591
fn target(&'a self, edge: &Self::Edge) -> Self::Node;
592592
}
593593

594-
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
594+
#[derive(Clone, PartialEq, Eq, Debug)]
595595
pub enum RenderOption {
596596
NoEdgeLabels,
597597
NoNodeLabels,
598598
NoEdgeStyles,
599599
NoNodeStyles,
600600

601-
Monospace,
601+
Fontname(String),
602602
DarkTheme,
603603
}
604604

@@ -633,11 +633,14 @@ where
633633
// Global graph properties
634634
let mut graph_attrs = Vec::new();
635635
let mut content_attrs = Vec::new();
636-
if options.contains(&RenderOption::Monospace) {
637-
let font = r#"fontname="Courier, monospace""#;
638-
graph_attrs.push(font);
639-
content_attrs.push(font);
640-
};
636+
let font;
637+
if let Some(fontname) = options.iter().find_map(|option| {
638+
if let RenderOption::Fontname(fontname) = option { Some(fontname) } else { None }
639+
}) {
640+
font = format!(r#"fontname="{}""#, fontname);
641+
graph_attrs.push(&font[..]);
642+
content_attrs.push(&font[..]);
643+
}
641644
if options.contains(&RenderOption::DarkTheme) {
642645
graph_attrs.push(r#"bgcolor="black""#);
643646
content_attrs.push(r#"color="white""#);

0 commit comments

Comments
 (0)