mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-25 22:51:32 +00:00
fmt it
This commit is contained in:
@ -6,8 +6,8 @@ use std::{
|
|||||||
path::PathBuf,
|
path::PathBuf,
|
||||||
};
|
};
|
||||||
|
|
||||||
use wasmer_runtime_core::cache::{Error as CacheError};
|
use wasmer_runtime_core::cache::Error as CacheError;
|
||||||
pub use wasmer_runtime_core::cache::{Artifact, Cache, WasmHash, cache_versioned_sub_directory};
|
pub use wasmer_runtime_core::cache::{cache_versioned_sub_directory, Artifact, Cache, WasmHash};
|
||||||
|
|
||||||
/// Representation of a directory that contains compiled wasm artifacts.
|
/// Representation of a directory that contains compiled wasm artifacts.
|
||||||
///
|
///
|
||||||
@ -54,7 +54,10 @@ impl FileSystemCache {
|
|||||||
let metadata = path.metadata()?;
|
let metadata = path.metadata()?;
|
||||||
if metadata.is_dir() {
|
if metadata.is_dir() {
|
||||||
if !metadata.permissions().readonly() {
|
if !metadata.permissions().readonly() {
|
||||||
Ok(Self { path, versioned_sub_directory })
|
Ok(Self {
|
||||||
|
path,
|
||||||
|
versioned_sub_directory,
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
// This directory is readonly.
|
// This directory is readonly.
|
||||||
Err(io::Error::new(
|
Err(io::Error::new(
|
||||||
@ -75,7 +78,10 @@ impl FileSystemCache {
|
|||||||
} else {
|
} else {
|
||||||
// Create the directory and any parent directories if they don't yet exist.
|
// Create the directory and any parent directories if they don't yet exist.
|
||||||
create_dir_all(&path)?;
|
create_dir_all(&path)?;
|
||||||
Ok(Self { path, versioned_sub_directory })
|
Ok(Self {
|
||||||
|
path,
|
||||||
|
versioned_sub_directory,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,9 @@ use structopt::StructOpt;
|
|||||||
use wasmer::webassembly::InstanceABI;
|
use wasmer::webassembly::InstanceABI;
|
||||||
use wasmer::*;
|
use wasmer::*;
|
||||||
use wasmer_emscripten;
|
use wasmer_emscripten;
|
||||||
use wasmer_runtime::cache::{Cache as BaseCache, FileSystemCache, WasmHash, cache_versioned_sub_directory};
|
use wasmer_runtime::cache::{
|
||||||
|
cache_versioned_sub_directory, Cache as BaseCache, FileSystemCache, WasmHash,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Debug, StructOpt)]
|
#[derive(Debug, StructOpt)]
|
||||||
#[structopt(name = "wasmer", about = "Wasm execution runtime.")]
|
#[structopt(name = "wasmer", about = "Wasm execution runtime.")]
|
||||||
|
Reference in New Issue
Block a user