Skip to content

Commit

Permalink
Use Into instead of AsRef in build script
Browse files Browse the repository at this point in the history
  • Loading branch information
BradLugo committed Jun 13, 2019
1 parent dc3ca10 commit faf8435
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ extern crate ron;
use std::env;
use std::fs::{read_dir, File};
use std::io::Write;
use std::path::{Path, PathBuf};
use std::path::PathBuf;

use ron::de::from_reader;

fn path(env: &str, s: &str) -> PathBuf {
PathBuf::from(env::var(env).unwrap()).join(s)
}

fn read_template_index<P: AsRef<Path>>(p: P) -> Vec<String> {
fn read_template_index<P: Into<PathBuf>>(p: P) -> Vec<String> {
let mut path = PathBuf::new();
path.push(p);
path.push(p.into());
path.push("index.ron");
from_reader(File::open(&path).expect("Failed to open index.ron"))
.expect("Failed to parse template index")
Expand Down

0 comments on commit faf8435

Please sign in to comment.