summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Batischev <eual.jp@gmail.com>2021-07-21 22:09:07 +0300
committerAlexander Batischev <eual.jp@gmail.com>2021-07-21 22:25:50 +0300
commit81be37c67d3916823b5386f7a001fe1890d4bd7f (patch)
tree6cbd8a3b5227f47b6c2985578ae8b2f664faa4e5 /src
parent4dfba7091c1499917839f311c50b5032c0b561e0 (diff)
downloadobnam2-81be37c67d3916823b5386f7a001fe1890d4bd7f.tar.gz
Replace NascentResult with plain Result
Diffstat (limited to 'src')
-rw-r--r--src/generation.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/generation.rs b/src/generation.rs
index 893d23b..c61306a 100644
--- a/src/generation.rs
+++ b/src/generation.rs
@@ -37,10 +37,8 @@ pub enum NascentError {
TempFile(#[from] std::io::Error),
}
-pub type NascentResult<T> = Result<T, NascentError>;
-
impl NascentGeneration {
- pub fn create<P>(filename: P) -> NascentResult<Self>
+ pub fn create<P>(filename: P) -> Result<Self, NascentError>
where
P: AsRef<Path>,
{
@@ -57,7 +55,7 @@ impl NascentGeneration {
e: FilesystemEntry,
ids: &[ChunkId],
reason: Reason,
- ) -> NascentResult<()> {
+ ) -> Result<(), NascentError> {
let t = self.conn.transaction().map_err(NascentError::Transaction)?;
self.fileno += 1;
sql::insert_one(&t, e, self.fileno, ids, reason)?;
@@ -68,7 +66,7 @@ impl NascentGeneration {
pub fn insert_iter(
&mut self,
entries: impl Iterator<Item = Result<FsEntryBackupOutcome, BackupError>>,
- ) -> NascentResult<Vec<BackupError>> {
+ ) -> Result<Vec<BackupError>, NascentError> {
let t = self.conn.transaction().map_err(NascentError::Transaction)?;
let mut warnings = vec![];
for r in entries {