aboutsummaryrefslogtreecommitdiff
path: root/bin/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'bin/src/config.rs')
-rw-r--r--bin/src/config.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/src/config.rs b/bin/src/config.rs
index cbb1f66..ef3a29d 100644
--- a/bin/src/config.rs
+++ b/bin/src/config.rs
@@ -190,9 +190,12 @@ fn walk_with_ignores<P: AsRef<Path>>(
190fn vfs(files: Vec<PathBuf>) -> Result<ReadOnlyVfs, ConfigErr> { 190fn vfs(files: Vec<PathBuf>) -> Result<ReadOnlyVfs, ConfigErr> {
191 let mut vfs = ReadOnlyVfs::default(); 191 let mut vfs = ReadOnlyVfs::default();
192 for file in files.iter() { 192 for file in files.iter() {
193 let _id = vfs.alloc_file_id(&file); 193 if let Ok(data) = fs::read_to_string(&file) {
194 let data = fs::read_to_string(&file).map_err(ConfigErr::InvalidPath)?; 194 let _id = vfs.alloc_file_id(&file);
195 vfs.set_file_contents(&file, data.as_bytes()); 195 vfs.set_file_contents(&file, data.as_bytes());
196 } else {
197 println!("{} contains non-utf8 content", file.display());
198 };
196 } 199 }
197 Ok(vfs) 200 Ok(vfs)
198} 201}