core: Made NullNavigatorBackend no longer use unwraps
This commit is contained in:
parent
84d0111a14
commit
7a9e8b4771
|
@ -249,11 +249,11 @@ impl NullNavigatorBackend {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn with_base_path(path: &Path, executor: &NullExecutor) -> Self {
|
||||
Self {
|
||||
pub fn with_base_path(path: &Path, executor: &NullExecutor) -> Result<Self, std::io::Error> {
|
||||
Ok(Self {
|
||||
spawner: executor.spawner(),
|
||||
relative_base_path: path.canonicalize().unwrap(),
|
||||
}
|
||||
relative_base_path: path.canonicalize()?,
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(any(unix, windows, target_os = "redox"))]
|
||||
|
|
|
@ -21,7 +21,7 @@ fn execute_swf(file: &Path) {
|
|||
let frame_time = 1000.0 / movie.frame_rate().to_f64();
|
||||
let player = PlayerBuilder::new()
|
||||
.with_log(ScanLogBackend::new())
|
||||
.with_navigator(NullNavigatorBackend::with_base_path(base_path, &executor))
|
||||
.with_navigator(NullNavigatorBackend::with_base_path(base_path, &executor).unwrap())
|
||||
.with_max_execution_duration(Duration::from_secs(300))
|
||||
.with_movie(movie)
|
||||
.build();
|
||||
|
|
|
@ -1444,7 +1444,7 @@ fn run_swf(
|
|||
|
||||
let player = builder
|
||||
.with_log(TestLogBackend::new(trace_output.clone()))
|
||||
.with_navigator(NullNavigatorBackend::with_base_path(base_path, &executor))
|
||||
.with_navigator(NullNavigatorBackend::with_base_path(base_path, &executor)?)
|
||||
.with_max_execution_duration(Duration::from_secs(300))
|
||||
.with_viewport_dimensions(
|
||||
movie.width().to_pixels() as u32,
|
||||
|
|
Loading…
Reference in New Issue