cl-typeck: Refactor display for Def.
- Use the FmtAdapter from cl-ast - Add a new delimiter-constructing delimit_with function.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
use delimiters::Delimiters;
|
||||
use std::fmt::Write;
|
||||
|
||||
@@ -7,9 +6,14 @@ pub trait FmtAdapter: Write {
|
||||
fn indent(&mut self) -> Indent<Self> {
|
||||
Indent { f: self }
|
||||
}
|
||||
|
||||
fn delimit(&mut self, delim: Delimiters) -> Delimit<Self> {
|
||||
Delimit::new(self, delim)
|
||||
}
|
||||
|
||||
fn delimit_with(&mut self, open: &'static str, close: &'static str) -> Delimit<Self> {
|
||||
Delimit::new(self, Delimiters { open, close })
|
||||
}
|
||||
}
|
||||
|
||||
/// Pads text with leading indentation after every newline
|
||||
|
||||
Reference in New Issue
Block a user