Skip to content

Commit

Permalink
Merge pull request rust-num#117 from serde-rs/rustfmt
Browse files Browse the repository at this point in the history
Run rustfmt
  • Loading branch information
dtolnay authored Jul 15, 2016
2 parents b61d90d + 56662d4 commit c09ea4a
Show file tree
Hide file tree
Showing 11 changed files with 673 additions and 752 deletions.
14 changes: 7 additions & 7 deletions json/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

use serde::ser;

use value::{self, Value, Map};
use value::{self, Map, Value};

/// This structure provides a simple interface for constructing a JSON array.
#[derive(Default)]
Expand All @@ -62,8 +62,8 @@ impl ArrayBuilder {

/// Creates and passes an `ArrayBuilder` into a closure, then inserts the resulting array into
/// this array.
pub fn push_array<F>(mut self, f: F) -> ArrayBuilder where
F: FnOnce(ArrayBuilder) -> ArrayBuilder
pub fn push_array<F>(mut self, f: F) -> ArrayBuilder
where F: FnOnce(ArrayBuilder) -> ArrayBuilder,
{
let builder = ArrayBuilder::new();
self.array.push(f(builder).build());
Expand All @@ -72,8 +72,8 @@ impl ArrayBuilder {

/// Creates and passes an `ArrayBuilder` into a closure, then inserts the resulting object into
/// this array.
pub fn push_object<F>(mut self, f: F) -> ArrayBuilder where
F: FnOnce(ObjectBuilder) -> ObjectBuilder
pub fn push_object<F>(mut self, f: F) -> ArrayBuilder
where F: FnOnce(ObjectBuilder) -> ObjectBuilder,
{
let builder = ObjectBuilder::new();
self.array.push(f(builder).build());
Expand Down Expand Up @@ -111,7 +111,7 @@ impl ObjectBuilder {
/// this object.
pub fn insert_array<S, F>(mut self, key: S, f: F) -> ObjectBuilder
where S: Into<String>,
F: FnOnce(ArrayBuilder) -> ArrayBuilder
F: FnOnce(ArrayBuilder) -> ArrayBuilder,
{
let builder = ArrayBuilder::new();
self.object.insert(key.into(), f(builder).build());
Expand All @@ -122,7 +122,7 @@ impl ObjectBuilder {
/// this object.
pub fn insert_object<S, F>(mut self, key: S, f: F) -> ObjectBuilder
where S: Into<String>,
F: FnOnce(ObjectBuilder) -> ObjectBuilder
F: FnOnce(ObjectBuilder) -> ObjectBuilder,
{
let builder = ObjectBuilder::new();
self.object.insert(key.into(), f(builder).build());
Expand Down
Loading

0 comments on commit c09ea4a

Please sign in to comment.