mirror of
https://github.com/nivekuil/rip
synced 2024-11-10 06:04:17 +00:00
Make rip work on stable
This commit is contained in:
parent
8d8e1b9225
commit
c416dd94e8
3 changed files with 4 additions and 6 deletions
|
@ -4,6 +4,7 @@ version = "0.11.4"
|
|||
authors = ["mail@nivekuil.com"]
|
||||
description = "rip: a safe and ergonomic alternative to rm"
|
||||
repository = "https://github.com/nivekuil/rip"
|
||||
readme = "README.org"
|
||||
license = "GPL-3.0+"
|
||||
include = [
|
||||
"**/*.rs",
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
// -*- compile-command: "cargo build" -*-
|
||||
#![feature(conservative_impl_trait)]
|
||||
#![feature(io)]
|
||||
#![feature(alloc_system)]
|
||||
extern crate alloc_system;
|
||||
#[macro_use]
|
||||
extern crate clap;
|
||||
extern crate core;
|
||||
|
@ -420,7 +416,7 @@ fn record_entry(line: &str) -> RecordItem {
|
|||
}
|
||||
|
||||
/// Takes a vector of grave paths and returns the respective lines in the record
|
||||
fn lines_of_graves<'a>(f: fs::File, graves: &'a [PathBuf]) -> impl Iterator<Item = String> {
|
||||
fn lines_of_graves<'a>(f: fs::File, graves: &'a [PathBuf]) -> impl Iterator<Item = String> + 'a {
|
||||
BufReader::new(f)
|
||||
.lines()
|
||||
.filter_map(|l| l.ok())
|
||||
|
|
|
@ -26,8 +26,9 @@ fn prompt_yes<T: AsRef<str>>(prompt: T) -> bool {
|
|||
println!("{} (y/N)", prompt.as_ref());
|
||||
}
|
||||
let stdin = BufReader::new(io::stdin());
|
||||
stdin.chars().next()
|
||||
stdin.bytes().next()
|
||||
.and_then(|c| c.ok())
|
||||
.map(|c| c as char)
|
||||
.and_then(|c| Some(c == 'y' || c == 'Y'))
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue