summaryrefslogtreecommitdiffstats
path: root/libimagstore
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-05-26 22:17:08 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-05-26 22:17:08 +0200
commit25c4bea8189c180802367f50f034a79f57071e50 (patch)
treec96e53a02d8029099cde17eac469b8c703c1d624 /libimagstore
parentfdb5d1bb24377884fc8827d5895d1a0149017c3a (diff)
Shorten type names in import
Diffstat (limited to 'libimagstore')
-rw-r--r--libimagstore/src/lazyfile.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/libimagstore/src/lazyfile.rs b/libimagstore/src/lazyfile.rs
index 5079b686..1e5cd66d 100644
--- a/libimagstore/src/lazyfile.rs
+++ b/libimagstore/src/lazyfile.rs
@@ -1,6 +1,6 @@
use libimagerror::into::IntoError;
-use error::{StoreError, StoreErrorKind};
+use error::{StoreError as SE, StoreErrorKind as SEK};
use std::io::{Seek, SeekFrom};
use std::path::{Path, PathBuf};
use std::fs::{File, OpenOptions, create_dir_all};
@@ -33,7 +33,7 @@ impl LazyFile {
/**
* Get the mutable file behind a LazyFile object
*/
- pub fn get_file_mut(&mut self) -> Result<&mut File, StoreError> {
+ pub fn get_file_mut(&mut self) -> Result<&mut File, SE> {
debug!("Getting lazy file: {:?}", self);
let file = match *self {
LazyFile::File(ref mut f) => return {
@@ -41,13 +41,13 @@ impl LazyFile {
// access to the file to be in a different context
f.seek(SeekFrom::Start(0))
.map_err(Box::new)
- .map_err(|e| StoreErrorKind::FileNotCreated.into_error_with_cause(e))
+ .map_err(|e| SEK::FileNotCreated.into_error_with_cause(e))
.map(|_| f)
},
LazyFile::Absent(ref p) => {
try!(open_file(p)
.map_err(Box::new)
- .map_err(|e| StoreErrorKind::FileNotFound.into_error_with_cause(e))
+ .map_err(|e| SEK::FileNotFound.into_error_with_cause(e))
)
}
};
@@ -61,14 +61,14 @@ impl LazyFile {
/**
* Create a file out of this LazyFile object
*/
- pub fn create_file(&mut self) -> Result<&mut File, StoreError> {
+ pub fn create_file(&mut self) -> Result<&mut File, SE> {
debug!("Creating lazy file: {:?}", self);
let file = match *self {
LazyFile::File(ref mut f) => return Ok(f),
LazyFile::Absent(ref p) => {
try!(create_file(p)
.map_err(Box::new)
- .map_err(|e| StoreErrorKind::FileNotFound.into_error_with_cause(e))
+ .map_err(|e| SEK::FileNotFound.into_error_with_cause(e))
)
}
};