From 81be37c67d3916823b5386f7a001fe1890d4bd7f Mon Sep 17 00:00:00 2001 From: Alexander Batischev Date: Wed, 21 Jul 2021 22:09:07 +0300 Subject: Replace NascentResult with plain Result --- src/generation.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') 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 = Result; - impl NascentGeneration { - pub fn create

(filename: P) -> NascentResult + pub fn create

(filename: P) -> Result where P: AsRef, { @@ -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>, - ) -> NascentResult> { + ) -> Result, NascentError> { let t = self.conn.transaction().map_err(NascentError::Transaction)?; let mut warnings = vec![]; for r in entries { -- cgit v1.2.1