forked from rojo-rbx/rojo
Switch SnapshotMiddleware over to SnapshotError
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::{error::Error, fmt, io, path::PathBuf};
|
||||
|
||||
use crate::{imfs::FsError, snapshot::InstanceSnapshot};
|
||||
use crate::imfs::FsError;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct SnapshotError {
|
||||
|
||||
@@ -3,11 +3,13 @@ use std::path::{Path, PathBuf};
|
||||
use rbx_dom_weak::{RbxId, RbxTree};
|
||||
|
||||
use crate::{
|
||||
imfs::{FsResult, Imfs, ImfsEntry, ImfsFetcher, ImfsSnapshot},
|
||||
imfs::{Imfs, ImfsEntry, ImfsFetcher, ImfsSnapshot},
|
||||
snapshot::InstanceSnapshot,
|
||||
};
|
||||
|
||||
pub type SnapshotInstanceResult<'a> = FsResult<Option<InstanceSnapshot<'a>>>;
|
||||
use super::error::SnapshotError;
|
||||
|
||||
pub type SnapshotInstanceResult<'a> = Result<Option<InstanceSnapshot<'a>>, SnapshotError>;
|
||||
pub type SnapshotFileResult = Option<(String, ImfsSnapshot)>;
|
||||
|
||||
pub trait SnapshotMiddleware {
|
||||
|
||||
@@ -17,6 +17,8 @@ mod rbxm;
|
||||
mod rbxmx;
|
||||
mod txt;
|
||||
|
||||
pub use self::error::*;
|
||||
|
||||
use rbx_dom_weak::{RbxId, RbxTree};
|
||||
|
||||
use self::{
|
||||
|
||||
@@ -29,7 +29,7 @@ impl SnapshotMiddleware for SnapshotProject {
|
||||
|
||||
match imfs.get(project_path) {
|
||||
Err(ref err) if err.kind() == FsErrorKind::NotFound => {}
|
||||
Err(err) => return Err(err),
|
||||
Err(err) => return Err(err.into()),
|
||||
|
||||
// TODO: Do we need to muck with the relevant paths if we're a
|
||||
// project file within a folder? Should the folder path be the
|
||||
|
||||
Reference in New Issue
Block a user