2015-01-06 04:03:42 -06:00
|
|
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
// A reduced version of the rustbook ice. The problem this encountered
|
|
|
|
// had to do with trans ignoring binders.
|
|
|
|
|
2015-03-05 20:33:58 -06:00
|
|
|
#![feature(os)]
|
|
|
|
|
2015-01-06 04:03:42 -06:00
|
|
|
use std::iter;
|
|
|
|
use std::os;
|
2015-03-17 15:33:26 -05:00
|
|
|
use std::fs::File;
|
|
|
|
use std::io::prelude::*;
|
|
|
|
use std::env;
|
|
|
|
use std::path::Path;
|
2015-01-06 04:03:42 -06:00
|
|
|
|
2015-03-17 15:33:26 -05:00
|
|
|
pub fn parse_summary<R: Read>(_: R, _: &Path) {
|
2015-01-06 04:03:42 -06:00
|
|
|
let path_from_root = Path::new("");
|
2015-03-17 15:33:26 -05:00
|
|
|
Path::new(&iter::repeat("../")
|
2015-01-06 04:03:42 -06:00
|
|
|
.take(path_from_root.components().count() - 1)
|
|
|
|
.collect::<String>());
|
|
|
|
}
|
|
|
|
|
2015-03-17 15:33:26 -05:00
|
|
|
fn foo() {
|
|
|
|
let cwd = env::current_dir().unwrap();
|
2015-01-06 04:03:42 -06:00
|
|
|
let src = cwd.clone();
|
2015-03-17 15:33:26 -05:00
|
|
|
let summary = File::open(&src.join("SUMMARY.md")).unwrap();
|
2015-01-06 04:03:42 -06:00
|
|
|
let _ = parse_summary(summary, &src);
|
|
|
|
}
|
2015-03-17 15:33:26 -05:00
|
|
|
|
|
|
|
fn main() {}
|