You've already forked flix
Throw away flix files in favor of a flix database
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::Error;
|
||||
|
||||
/// An item returned by scanner streams
|
||||
#[derive(Debug)]
|
||||
pub struct Item<T> {
|
||||
/// The path of the item
|
||||
pub path: PathBuf,
|
||||
/// The event relating to the item
|
||||
pub event: Result<T, Error>,
|
||||
}
|
||||
|
||||
impl<T> Item<T> {
|
||||
/// Helper function for mapping the inner event [Result]
|
||||
#[inline]
|
||||
pub fn map<U, F: FnOnce(T) -> U>(self, op: F) -> Item<U> {
|
||||
Item {
|
||||
path: self.path,
|
||||
event: self.event.map(op),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user