Skip to content

Commit

Permalink
Remove needless borrows
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa committed Aug 2, 2021
1 parent 39faa03 commit 0c84ce1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/custom_yaml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl Dezoomer for CustomDezoomer {
self.assert(data.uri.ends_with("tiles.yaml"))?;
let contents = data.with_contents()?.contents;
let dezoomer: CustomYamlTiles =
serde_yaml::from_slice(&contents).map_err(DezoomerError::wrap)?;
serde_yaml::from_slice(contents).map_err(DezoomerError::wrap)?;
single_level(dezoomer)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/encoder/retiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl<T: TileSaver> Retiler<T> {
cur_tile_size,
self.original_size,
scale_factor,
&scaled_tile)?;
scaled_tile)?;
if let Some(tile_img) = finished {
self.tile_save(cur_pos, cur_tile_size, tile_img)?;
self.tiles.insert(cur_pos, None);
Expand Down
2 changes: 1 addition & 1 deletion src/krpano/krpano_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl TopLevelTags {
match self {
Self::SourceDetails { subject } => Some(subject),
Self::Data(bytes) =>
serde_json::from_str::<KrpanoMetaData>(&bytes).ok()
serde_json::from_str::<KrpanoMetaData>(bytes).ok()
.map(|m| m.title),
_ => None
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ async fn find_zoomlevel(args: &Arguments) -> Result<ZoomLevel, ZoomError> {
}

pub async fn dezoomify(args: &Arguments) -> Result<PathBuf, ZoomError> {
let zoom_level = find_zoomlevel(&args).await?;
let zoom_level = find_zoomlevel(args).await?;
let base_dir = current_dir()?;
let outname = get_outname(&args.outfile, &zoom_level.title(), &base_dir,zoom_level.size_hint());
let save_as = fs::canonicalize(outname.as_path()).unwrap_or_else(|_e| outname.clone());
Expand All @@ -160,7 +160,7 @@ pub async fn dezoomify_level(
) -> Result<(), ZoomError> {
let level_headers = zoom_level.http_headers();
let downloader = TileDownloader {
http_client: client(level_headers.iter().chain(args.headers()), &args, None)?,
http_client: client(level_headers.iter().chain(args.headers()), args, None)?,
post_process_fn: zoom_level.post_process_fn(),
retries: args.retries,
retry_delay: args.retry_delay,
Expand Down

0 comments on commit 0c84ce1

Please sign in to comment.