Skip to content

Commit

Permalink
format and fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ericswanson-dfinity committed May 2, 2024
1 parent 48c24fb commit df9bea9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/canisters/frontend/ic-asset/src/asset/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ mod with_tempdir {
#[cfg(target_family = "unix")]
use std::os::unix::prelude::PermissionsExt;
use std::{collections::BTreeMap, fs::File};
use std::error::Error;
use tempfile::{Builder, TempDir};

fn create_temporary_assets_directory(
Expand Down Expand Up @@ -887,16 +888,20 @@ mod with_tempdir {

let assets_config = AssetSourceDirectoryConfiguration::load(&assets_dir);
assert_eq!(
assets_config.err().unwrap().to_string(),
assets_config.as_ref().err().unwrap().to_string(),
format!(
"Failed to read {} as string: Permission denied (os error 13)",
"Failed to read {} as string",
assets_dir
.join(ASSETS_CONFIG_FILENAME_JSON)
.as_path()
.to_str()
.unwrap()
)
);
assert_eq!(
assets_config.err().unwrap().source().unwrap().to_string(),
"Permission denied (os error 13)"
);
}

#[test]
Expand Down
4 changes: 1 addition & 3 deletions src/dfx-core/src/error/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ pub enum ApplyExtensionCanisterTypesError {

#[derive(Error, Debug)]
pub enum ApplyExtensionCanisterTypeError {
#[error(
"failed to apply defaults from extension '{extension}' to canister '{canister}'"
)]
#[error("failed to apply defaults from extension '{extension}' to canister '{canister}'")]
ApplyDefaults {
canister: Box<String>,
extension: Box<String>,
Expand Down

0 comments on commit df9bea9

Please sign in to comment.