Make roc_cache_dir() panic if it can't find $HOME

This commit is contained in:
Richard Feldman 2022-11-20 20:48:09 -05:00
parent 4987fe1656
commit 7d2fa63dca
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
7 changed files with 31 additions and 61 deletions

View file

@ -453,9 +453,6 @@ fn render_sidebar<'a, I: Iterator<Item = (&'a ModuleDocumentation, Vec<String>)>
pub fn load_modules_for_files(filenames: Vec<PathBuf>) -> Vec<LoadedModule> {
let arena = Bump::new();
let roc_cache_dir = cache::roc_cache_dir().unwrap_or_else(|| {
todo!("Gracefully handle not being able to find default Roc cache dir.")
});
let mut modules = Vec::with_capacity(filenames.len());
for filename in filenames {
@ -470,7 +467,7 @@ pub fn load_modules_for_files(filenames: Vec<PathBuf>) -> Vec<LoadedModule> {
&arena,
filename,
Default::default(),
RocCacheDir::Persistent(roc_cache_dir.as_path()),
RocCacheDir::Persistent(cache::roc_cache_dir().as_path()),
load_config,
) {
Ok(loaded) => modules.push(loaded),