Merge pull request #23 from mwatts/feature/blobs
remove warnings about Itertools::intersperse
This commit is contained in:
commit
e64e2cf2f2
1 changed files with 15 additions and 9 deletions
|
@ -57,10 +57,13 @@ impl Value {
|
||||||
{
|
{
|
||||||
let open = open.into();
|
let open = open.into();
|
||||||
let n = open.len() as isize;
|
let n = open.len() as isize;
|
||||||
let i = vs
|
let i = {
|
||||||
|
let this = vs
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|v| v.as_doc(allocator))
|
.map(|v| v.as_doc(allocator));
|
||||||
.intersperse(allocator.line());
|
let element = allocator.line();
|
||||||
|
Itertools::intersperse(this, element)
|
||||||
|
};
|
||||||
allocator
|
allocator
|
||||||
.text(open)
|
.text(open)
|
||||||
.append(allocator.concat(i).nest(n))
|
.append(allocator.concat(i).nest(n))
|
||||||
|
@ -81,11 +84,14 @@ impl Value {
|
||||||
Value::List(ref vs) => self.bracket(pp, "(", vs, ")"),
|
Value::List(ref vs) => self.bracket(pp, "(", vs, ")"),
|
||||||
Value::Set(ref vs) => self.bracket(pp, "#{", vs, "}"),
|
Value::Set(ref vs) => self.bracket(pp, "#{", vs, "}"),
|
||||||
Value::Map(ref vs) => {
|
Value::Map(ref vs) => {
|
||||||
let xs = vs
|
let xs = {
|
||||||
|
let this = vs
|
||||||
.iter()
|
.iter()
|
||||||
.rev()
|
.rev()
|
||||||
.map(|(k, v)| k.as_doc(pp).append(pp.line()).append(v.as_doc(pp)).group())
|
.map(|(k, v)| k.as_doc(pp).append(pp.line()).append(v.as_doc(pp)).group());
|
||||||
.intersperse(pp.line());
|
let element = pp.line();
|
||||||
|
Itertools::intersperse(this, element)
|
||||||
|
};
|
||||||
pp.text("{")
|
pp.text("{")
|
||||||
.append(pp.concat(xs).nest(1))
|
.append(pp.concat(xs).nest(1))
|
||||||
.append(pp.text("}"))
|
.append(pp.text("}"))
|
||||||
|
|
Loading…
Reference in a new issue