Skip to content

Commit

Permalink
Refactor error handling in StdinSource module
Browse files Browse the repository at this point in the history
Signed-off-by: simonsan <[email protected]>
  • Loading branch information
simonsan committed Oct 16, 2024
1 parent 334454e commit 866d359
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions crates/core/src/backend/stdin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ use std::{
path::PathBuf,
};

use crate::{
backend::{ReadSource, ReadSourceEntry},
error::RusticResult,
};
use crate::backend::{BackendAccessErrorKind, ReadSource, ReadSourceEntry};

/// The `StdinSource` is a `ReadSource` for stdin.
#[derive(Debug, Clone)]
Expand All @@ -24,13 +21,14 @@ impl StdinSource {
}

impl ReadSource for StdinSource {
type Error = BackendAccessErrorKind;
/// The open type.
type Open = Stdin;
/// The iterator type.
type Iter = Once<RusticResult<ReadSourceEntry<Stdin>>>;
type Iter = Once<Result<ReadSourceEntry<Stdin>, Self::Error>>;

/// Returns the size of the source.
fn size(&self) -> RusticResult<Option<u64>> {
fn size(&self) -> Result<Option<u64>, Self::Error> {
Ok(None)
}

Expand Down

0 comments on commit 866d359

Please sign in to comment.