Skip to content

Commit d3697c8

Browse files
committed
Remove (lots of) dead code
Found with https://github.com/est31/warnalyzer. Dubious changes: - Is anyone else using rustc_apfloat? I feel weird completely deleting x87 support. - Maybe some of the dead code in rustc_data_structures, in case someone wants to use it in the future? - Don't change rustc_serialize I plan to scrap most of the json module in the near future (see rust-lang/compiler-team#418) and fixing the tests needed more work than I expected. TODO: check if any of the comments on the deleted code should be kept.
1 parent 0c96f42 commit d3697c8

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

src/lib.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,6 @@ impl<'a> Id<'a> {
413413
pub fn as_slice(&'a self) -> &'a str {
414414
&*self.name
415415
}
416-
417-
pub fn name(self) -> Cow<'a, str> {
418-
self.name
419-
}
420416
}
421417

422418
/// Each instance of a type that implements `Label<C>` maps to a
@@ -484,10 +480,6 @@ impl<'a> LabelText<'a> {
484480
LabelStr(s.into())
485481
}
486482

487-
pub fn escaped<S: Into<Cow<'a, str>>>(s: S) -> LabelText<'a> {
488-
EscStr(s.into())
489-
}
490-
491483
pub fn html<S: Into<Cow<'a, str>>>(s: S) -> LabelText<'a> {
492484
HtmlStr(s.into())
493485
}
@@ -543,11 +535,6 @@ impl<'a> LabelText<'a> {
543535
}
544536
}
545537

546-
/// Puts `prefix` on a line above this label, with a blank line separator.
547-
pub fn prefix_line(self, prefix: LabelText<'_>) -> LabelText<'static> {
548-
prefix.suffix_line(self)
549-
}
550-
551538
/// Puts `suffix` on a line below this label, with a blank line separator.
552539
pub fn suffix_line(self, suffix: LabelText<'_>) -> LabelText<'static> {
553540
let mut prefix = self.pre_escaped_content().into_owned();
@@ -602,11 +589,6 @@ pub enum RenderOption {
602589
DarkTheme,
603590
}
604591

605-
/// Returns vec holding all the default render options.
606-
pub fn default_options() -> Vec<RenderOption> {
607-
vec![]
608-
}
609-
610592
/// Renders directed graph `g` into the writer `w` in DOT syntax.
611593
/// (Simple wrapper around `render_opts` that passes a default set of options.)
612594
pub fn render<'a, N, E, G, W>(g: &'a G, w: &mut W) -> io::Result<()>

src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<'a> Labeller<'a> for LabelledGraph {
111111
fn node_label(&'a self, n: &Node) -> LabelText<'a> {
112112
match self.node_labels[*n] {
113113
Some(l) => LabelStr(l.into()),
114-
None => LabelStr(id_name(n).name()),
114+
None => LabelStr(id_name(n).name),
115115
}
116116
}
117117
fn edge_label(&'a self, e: &&'a Edge) -> LabelText<'a> {

0 commit comments

Comments
 (0)