roll back closure, remove unneeded slice & imports

This commit is contained in:
Andre Bogus 2016-05-14 20:12:19 +02:00
parent 12472ab397
commit cd224eaeff
3 changed files with 3 additions and 5 deletions

View file

@ -85,8 +85,8 @@ fn create_from_cli_spec(rt: &Runtime, matches: &ArgMatches, path: &PathBuf) -> R
fn create_from_source(rt: &Runtime, matches: &ArgMatches, path: &PathBuf) -> Result<()> { fn create_from_source(rt: &Runtime, matches: &ArgMatches, path: &PathBuf) -> Result<()> {
let content = matches let content = matches
.value_of("from-raw") .value_of("from-raw")
.ok_or_else(|| StoreError::new(StoreErrorKind::NoCommandlineCall, None)) .ok_or(StoreError::new(StoreErrorKind::NoCommandlineCall, None))
.map(|raw_src| string_from_raw_src(raw_src)); .map(string_from_raw_src);
if content.is_err() { if content.is_err() {
return content.map(|_| ()); return content.map(|_| ());

View file

@ -1,5 +1,5 @@
use regex::Regex; use regex::Regex;
pub fn is_tag(s: &str) -> bool { pub fn is_tag(s: &str) -> bool {
Regex::new("^[a-zA-Z]([a-zA-Z0-9_-]*)$").unwrap().captures(&s[..]).is_some() Regex::new("^[a-zA-Z]([a-zA-Z0-9_-]*)$").unwrap().captures(s).is_some()
} }

View file

@ -7,7 +7,6 @@ use std::sync::Arc;
use std::sync::RwLock; use std::sync::RwLock;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::io::{Seek, SeekFrom}; use std::io::{Seek, SeekFrom};
use std::io::Write;
use std::convert::From; use std::convert::From;
use std::convert::Into; use std::convert::Into;
use std::sync::Mutex; use std::sync::Mutex;
@ -30,7 +29,6 @@ use lazyfile::LazyFile;
use hook::aspect::Aspect; use hook::aspect::Aspect;
use hook::accessor::{ MutableHookDataAccessor, use hook::accessor::{ MutableHookDataAccessor,
NonMutableHookDataAccessor,
StoreIdAccessor}; StoreIdAccessor};
use hook::position::HookPosition; use hook::position::HookPosition;
use hook::Hook; use hook::Hook;