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