1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 18:06:14 +03:00

Extract pretty from the extension.

This commit is contained in:
Rob Rix 2015-09-28 17:10:12 -04:00
parent d3b27cfba4
commit 2ef4ca02a1

View File

@ -118,18 +118,18 @@ func fits(w: Int, _ x: Doc) -> Bool {
}
}
func pretty(w: Int, _ doc: DOC) -> String {
return best(w, 0, doc).description
}
public protocol CustomDocConvertible: CustomStringConvertible {
var doc: DOC { get }
}
extension CustomDocConvertible {
private func pretty(w: Int) -> String {
return best(w, 0, doc).description
}
public var description: String {
return pretty(70)
return pretty(70, doc)
}
}