Skip to content

Commit

Permalink
fix: panic when directory name contains japanese characters
Browse files Browse the repository at this point in the history
  • Loading branch information
roele committed Jan 14, 2025
1 parent 97fee36 commit 42002eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/backend/external_plugin_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fn render_cache_key(config: &Config, tv: &ToolVersion, cache_key: &[String]) ->
let s = s.trim().to_string();
trace!("cache key element: {} -> {}", tmpl.trim(), s);
let mut s = hash_to_str(&s);
s.truncate(10);
s = s.chars().take(10).collect();
s
})
.collect::<Vec<String>>();
Expand Down
2 changes: 1 addition & 1 deletion src/config/config_file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ fn hashed_path_filename(path: &Path) -> String {
let hash = hash_to_str(&canonicalized_path);
let trunc_str = |s: &OsStr| {
let mut s = s.to_str().unwrap().to_string();
s.truncate(20);
s = s.chars().take(20).collect();
s
};
let trust_path = dirs::TRUSTED_CONFIGS.join(hash_to_str(&hash));
Expand Down

0 comments on commit 42002eb

Please sign in to comment.