From 4322d1b0b7041eb160b1baadf9f6e63f0d4e9d9c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 22 Dec 2019 19:43:32 +0000 Subject: Update abnf dependency in the hopes of fixing a bug --- dhall/Cargo.toml | 2 +- dhall/build.rs | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'dhall') diff --git a/dhall/Cargo.toml b/dhall/Cargo.toml index 34cf444..8674f44 100644 --- a/dhall/Cargo.toml +++ b/dhall/Cargo.toml @@ -26,7 +26,7 @@ pretty_assertions = "0.6.1" [build-dependencies] walkdir = "2" -abnf_to_pest = { version = "0.1.2", path = "../abnf_to_pest" } +abnf_to_pest = { version = "0.2.0", path = "../abnf_to_pest" } pest_generator = "2.1" quote = "1.0" diff --git a/dhall/build.rs b/dhall/build.rs index ec06ece..2a65f24 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -1,7 +1,7 @@ use std::env; use std::ffi::OsString; -use std::fs::File; -use std::io::{BufRead, BufReader, Read, Write}; +use std::fs::{read_to_string, File}; +use std::io::{BufRead, BufReader, Write}; use std::path::{Path, PathBuf}; use walkdir::WalkDir; @@ -383,10 +383,8 @@ fn convert_abnf_to_pest() -> std::io::Result<()> { println!("cargo:rerun-if-changed={}", abnf_path); println!("cargo:rerun-if-changed={}", visibility_path); - let mut file = File::open(abnf_path)?; - let mut data = Vec::new(); - file.read_to_end(&mut data)?; - data.push('\n' as u8); + let mut data = read_to_string(abnf_path)?; + data.push('\n'); let mut rules = abnf_to_pest::parse_abnf(&data)?; for line in BufReader::new(File::open(visibility_path)?).lines() { -- cgit v1.2.3