mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-25 15:16:07 +00:00
Fix uses using failure::Error
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
use std::{
|
use std::{
|
||||||
collections::{HashMap, HashSet},
|
collections::{HashMap, HashSet},
|
||||||
io,
|
|
||||||
fs,
|
fs,
|
||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use failure::Error;
|
||||||
use tempfile::{TempDir, tempdir};
|
use tempfile::{TempDir, tempdir};
|
||||||
|
|
||||||
use librojo::{
|
use librojo::{
|
||||||
@@ -19,7 +19,7 @@ enum FsEvent {
|
|||||||
Moved(PathBuf, PathBuf),
|
Moved(PathBuf, PathBuf),
|
||||||
}
|
}
|
||||||
|
|
||||||
fn send_events(imfs: &mut Imfs, events: &[FsEvent]) -> io::Result<()> {
|
fn send_events(imfs: &mut Imfs, events: &[FsEvent]) -> Result<(), Error> {
|
||||||
for event in events {
|
for event in events {
|
||||||
match event {
|
match event {
|
||||||
FsEvent::Created(path) => imfs.path_created(path)?,
|
FsEvent::Created(path) => imfs.path_created(path)?,
|
||||||
@@ -56,7 +56,7 @@ fn check_expected(real: &Imfs, expected: &ExpectedImfs) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn base_tree() -> io::Result<(TempDir, Imfs, ExpectedImfs, TestResources)> {
|
fn base_tree() -> Result<(TempDir, Imfs, ExpectedImfs, TestResources), Error> {
|
||||||
let root = tempdir()?;
|
let root = tempdir()?;
|
||||||
|
|
||||||
let foo_path = root.path().join("foo");
|
let foo_path = root.path().join("foo");
|
||||||
@@ -125,7 +125,7 @@ fn base_tree() -> io::Result<(TempDir, Imfs, ExpectedImfs, TestResources)> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn initial_read() -> io::Result<()> {
|
fn initial_read() -> Result<(), Error> {
|
||||||
let (_root, imfs, expected_imfs, _resources) = base_tree()?;
|
let (_root, imfs, expected_imfs, _resources) = base_tree()?;
|
||||||
|
|
||||||
check_expected(&imfs, &expected_imfs);
|
check_expected(&imfs, &expected_imfs);
|
||||||
@@ -134,7 +134,7 @@ fn initial_read() -> io::Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn adding_files() -> io::Result<()> {
|
fn adding_files() -> Result<(), Error> {
|
||||||
let (root, mut imfs, mut expected_imfs, resources) = base_tree()?;
|
let (root, mut imfs, mut expected_imfs, resources) = base_tree()?;
|
||||||
|
|
||||||
check_expected(&imfs, &expected_imfs);
|
check_expected(&imfs, &expected_imfs);
|
||||||
@@ -178,7 +178,7 @@ fn adding_files() -> io::Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn adding_folder() -> io::Result<()> {
|
fn adding_folder() -> Result<(), Error> {
|
||||||
let (root, imfs, mut expected_imfs, _resources) = base_tree()?;
|
let (root, imfs, mut expected_imfs, _resources) = base_tree()?;
|
||||||
|
|
||||||
check_expected(&imfs, &expected_imfs);
|
check_expected(&imfs, &expected_imfs);
|
||||||
@@ -255,7 +255,7 @@ fn adding_folder() -> io::Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn removing_file() -> io::Result<()> {
|
fn removing_file() -> Result<(), Error> {
|
||||||
let (root, mut imfs, mut expected_imfs, resources) = base_tree()?;
|
let (root, mut imfs, mut expected_imfs, resources) = base_tree()?;
|
||||||
|
|
||||||
check_expected(&imfs, &expected_imfs);
|
check_expected(&imfs, &expected_imfs);
|
||||||
@@ -279,7 +279,7 @@ fn removing_file() -> io::Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn removing_folder() -> io::Result<()> {
|
fn removing_folder() -> Result<(), Error> {
|
||||||
let (root, imfs, mut expected_imfs, resources) = base_tree()?;
|
let (root, imfs, mut expected_imfs, resources) = base_tree()?;
|
||||||
|
|
||||||
check_expected(&imfs, &expected_imfs);
|
check_expected(&imfs, &expected_imfs);
|
||||||
|
|||||||
Reference in New Issue
Block a user