mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 20:55:50 +00:00
Switch SnapshotMiddleware over to SnapshotError
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
use std::{error::Error, fmt, io, path::PathBuf};
|
use std::{error::Error, fmt, io, path::PathBuf};
|
||||||
|
|
||||||
use crate::{imfs::FsError, snapshot::InstanceSnapshot};
|
use crate::imfs::FsError;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct SnapshotError {
|
pub struct SnapshotError {
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ use std::path::{Path, PathBuf};
|
|||||||
use rbx_dom_weak::{RbxId, RbxTree};
|
use rbx_dom_weak::{RbxId, RbxTree};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
imfs::{FsResult, Imfs, ImfsEntry, ImfsFetcher, ImfsSnapshot},
|
imfs::{Imfs, ImfsEntry, ImfsFetcher, ImfsSnapshot},
|
||||||
snapshot::InstanceSnapshot,
|
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 type SnapshotFileResult = Option<(String, ImfsSnapshot)>;
|
||||||
|
|
||||||
pub trait SnapshotMiddleware {
|
pub trait SnapshotMiddleware {
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ mod rbxm;
|
|||||||
mod rbxmx;
|
mod rbxmx;
|
||||||
mod txt;
|
mod txt;
|
||||||
|
|
||||||
|
pub use self::error::*;
|
||||||
|
|
||||||
use rbx_dom_weak::{RbxId, RbxTree};
|
use rbx_dom_weak::{RbxId, RbxTree};
|
||||||
|
|
||||||
use self::{
|
use self::{
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ impl SnapshotMiddleware for SnapshotProject {
|
|||||||
|
|
||||||
match imfs.get(project_path) {
|
match imfs.get(project_path) {
|
||||||
Err(ref err) if err.kind() == FsErrorKind::NotFound => {}
|
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
|
// 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
|
// project file within a folder? Should the folder path be the
|
||||||
|
|||||||
Reference in New Issue
Block a user