diff options
author | Nadrieril | 2020-12-07 14:15:43 +0000 |
---|---|---|
committer | Nadrieril | 2020-12-07 19:34:39 +0000 |
commit | 8c5b3ff15f2125e9d731fc199e194e1993c36b37 (patch) | |
tree | a88ac770aa3e7605feed8381877f290a2b64cd43 /dhall/src/semantics/resolve/cache.rs | |
parent | 3c522217b7445c6df9e170d830f485086ad7e062 (diff) |
Thread cx everywhere else imports are read
Diffstat (limited to '')
-rw-r--r-- | dhall/src/semantics/resolve/cache.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/dhall/src/semantics/resolve/cache.rs b/dhall/src/semantics/resolve/cache.rs index 59463dd..9a5e835 100644 --- a/dhall/src/semantics/resolve/cache.rs +++ b/dhall/src/semantics/resolve/cache.rs @@ -68,11 +68,12 @@ impl Cache { pub fn insert<'cx>( &self, + cx: Ctxt<'cx>, hash: &Hash, expr: &Typed<'cx>, ) -> Result<(), Error> { let path = self.entry_path(hash); - write_cache_file(&path, expr) + write_cache_file(cx, &path, expr) } } @@ -97,8 +98,12 @@ fn read_cache_file<'cx>( } /// Write a file to the cache. -fn write_cache_file(path: &Path, expr: &Typed) -> Result<(), Error> { - let data = binary::encode(&expr.to_expr())?; +fn write_cache_file<'cx>( + cx: Ctxt<'cx>, + path: &Path, + expr: &Typed<'cx>, +) -> Result<(), Error> { + let data = binary::encode(&expr.to_expr(cx))?; File::create(path)?.write_all(data.as_slice())?; Ok(()) } |