From 74719869dc8aae53bf9521de55188c08f4ebaf11 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 8 Mar 2019 18:20:29 +0100 Subject: rustfmt --- dhall/src/lib.rs | 2 +- dhall/tests/macros.rs | 12 ++++++++---- dhall_parser/build.rs | 3 +-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/dhall/src/lib.rs b/dhall/src/lib.rs index 6372768..d7758f1 100644 --- a/dhall/src/lib.rs +++ b/dhall/src/lib.rs @@ -8,10 +8,10 @@ pub mod imports; pub mod typecheck; use dhall_core::*; +use std::fmt; use std::fs::File; use std::io::Read; use std::path::Path; -use std::fmt; #[derive(Debug)] pub enum DhallError { diff --git a/dhall/tests/macros.rs b/dhall/tests/macros.rs index b27b850..a126d5b 100644 --- a/dhall/tests/macros.rs +++ b/dhall/tests/macros.rs @@ -99,19 +99,23 @@ pub fn run_test(base_path: &str, feature: Feature, expected: ExpectedResult) { } (Feature::Parser, ExpectedResult::Failure) => { let file_path: PathBuf = (base_path.to_owned() + ".dhall").into(); - let err = load_dhall_file(&file_path, &mut source_pool, true).unwrap_err(); + let err = load_dhall_file(&file_path, &mut source_pool, true) + .unwrap_err(); match err { - DhallError::ParseError(_) => {}, + DhallError::ParseError(_) => {} e => panic!("Expected parse error, got: {:?}", e), } } (Feature::Normalization, ExpectedResult::Success) => { let expr_file_path = base_path.to_owned() + "A.dhall"; let mut expr_buffer = String::new(); - let expr = read_dhall_file(&expr_file_path, &mut expr_buffer).unwrap(); + let expr = + read_dhall_file(&expr_file_path, &mut expr_buffer).unwrap(); let expected_file_path = base_path.to_owned() + "B.dhall"; let mut expected_buffer = String::new(); - let expected = read_dhall_file(&expected_file_path, &mut expected_buffer).unwrap(); + let expected = + read_dhall_file(&expected_file_path, &mut expected_buffer) + .unwrap(); assert_eq_!( normalize::<_, _, X, _>(&expr), diff --git a/dhall_parser/build.rs b/dhall_parser/build.rs index bc342c1..d30e31e 100644 --- a/dhall_parser/build.rs +++ b/dhall_parser/build.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; +use std::env; use std::fs::File; use std::io::{BufRead, BufReader, Read, Write}; -use std::env; use std::path::Path; use abnf_to_pest::{abnf_to_pest, PestRuleSettings}; @@ -70,7 +70,6 @@ fn main() -> std::io::Result<()> { "final_expression = {{ SOI ~ complete_expression ~ EOI }}" )?; - // Generate pest parser manually to avoid spurious recompilations let derived = { let pest_path = "dhall.pest"; -- cgit v1.2.3