Remove extraneous lifetimes

This commit is contained in:
Ben S 2014-06-01 16:30:18 +01:00
parent a631bc099f
commit 5abd53742e
2 changed files with 5 additions and 5 deletions

View File

@ -28,7 +28,7 @@ pub struct File<'a> {
pub ext: Option<&'a str>, pub ext: Option<&'a str>,
pub path: &'a Path, pub path: &'a Path,
pub stat: io::FileStat, pub stat: io::FileStat,
pub parts: Vec<SortPart<'a>>, pub parts: Vec<SortPart>,
} }
impl<'a> File<'a> { impl<'a> File<'a> {

View File

@ -10,13 +10,13 @@ use std::ascii::StrAsciiExt;
// Vec<SortPart> will automatically have natural sorting. // Vec<SortPart> will automatically have natural sorting.
#[deriving(Eq, Ord, TotalEq, TotalOrd)] #[deriving(Eq, Ord, TotalEq, TotalOrd)]
pub enum SortPart<'a> { pub enum SortPart {
Numeric(u64), Numeric(u64),
Stringular(String), Stringular(String),
} }
impl<'a> SortPart<'a> { impl SortPart {
pub fn from_string(is_digit: bool, slice: &'a str) -> SortPart<'a> { pub fn from_string(is_digit: bool, slice: &str) -> SortPart {
if is_digit { if is_digit {
Numeric(from_str::<u64>(slice).expect(slice.to_owned())) Numeric(from_str::<u64>(slice).expect(slice.to_owned()))
} else { } else {
@ -27,7 +27,7 @@ impl<'a> SortPart<'a> {
// The logic here is taken from my question at // The logic here is taken from my question at
// http://stackoverflow.com/q/23969191/3484614 // http://stackoverflow.com/q/23969191/3484614
pub fn split_into_parts<'a>(input: &'a str) -> Vec<SortPart<'a>> { pub fn split_into_parts(input: &str) -> Vec<SortPart> {
let mut parts = vec![]; let mut parts = vec![];
if input.is_empty() { if input.is_empty() {