fix: remove assert to check cache format (#689)
* fix: remove assert * rustmft
This commit is contained in:
parent
3338cdead1
commit
4bb2636b77
|
@ -273,20 +273,14 @@ impl SolFilesCacheBuilder {
|
||||||
files.insert(file, entry);
|
files.insert(file, entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
let cache = if let Some(ref dest) = dest {
|
let cache = if let Some(dest) = dest.as_ref().filter(|dest| dest.exists()) {
|
||||||
if dest.exists() {
|
// read the existing cache and extend it by the files that changed
|
||||||
// read the existing cache and extend it by the files that changed
|
// (if we just wrote to the cache file, we'd overwrite the existing data)
|
||||||
// (if we just wrote to the cache file, we'd overwrite the existing data)
|
let reader =
|
||||||
let reader = std::io::BufReader::new(
|
std::io::BufReader::new(File::open(dest).map_err(|err| SolcError::io(err, dest))?);
|
||||||
File::open(dest).map_err(|err| SolcError::io(err, dest))?,
|
let mut cache: SolFilesCache = serde_json::from_reader(reader)?;
|
||||||
);
|
cache.files.extend(files);
|
||||||
let mut cache: SolFilesCache = serde_json::from_reader(reader)?;
|
cache
|
||||||
assert_eq!(cache.format, format);
|
|
||||||
cache.files.extend(files);
|
|
||||||
cache
|
|
||||||
} else {
|
|
||||||
SolFilesCache { format, files }
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
SolFilesCache { format, files }
|
SolFilesCache { format, files }
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue