Update pretty_print dependency and fix issues.

This commit is contained in:
Greg Burd 2020-01-23 11:14:29 -05:00
parent fcb3a9182f
commit ef1c196516
2 changed files with 5 additions and 5 deletions

View file

@ -14,7 +14,7 @@ chrono = "0.4"
itertools = "0.8"
num = "0.2"
ordered-float = "1.0"
pretty = "0.2"
pretty = "0.9"
uuid = { version = "0.8", features = ["v4", "serde"] }
serde = { version = "1.0", optional = true }
serde_derive = { version = "1.0", optional = true }

View file

@ -56,11 +56,11 @@ impl Value {
I: IntoIterator<Item = &'a Value>,
{
let open = open.into();
let n = open.len();// as isize;
let n = open.len() as isize;
let i = vs
.into_iter()
.map(|v| v.as_doc(allocator))
.intersperse(allocator.space());
.intersperse(allocator.line());
allocator
.text(open)
.append(allocator.concat(i).nest(n))
@ -84,8 +84,8 @@ impl Value {
let xs = vs
.iter()
.rev()
.map(|(k, v)| k.as_doc(pp).append(pp.space()).append(v.as_doc(pp)).group())
.intersperse(pp.space());
.map(|(k, v)| k.as_doc(pp).append(pp.line()).append(v.as_doc(pp)).group())
.intersperse(pp.line());
pp.text("{")
.append(pp.concat(xs).nest(1))
.append(pp.text("}"))