wrap resource_error into an error/2 functor and don't wrap it into a syntax_error functor
This commit is contained in:
14
src/read.rs
14
src/read.rs
@@ -379,9 +379,7 @@ impl<'a> TermWriter<'a> {
|
||||
|
||||
#[inline]
|
||||
fn push_cell(&mut self, cell: HeapCellValue) -> Result<(), CompilationError> {
|
||||
self.heap
|
||||
.push_cell(cell)
|
||||
.map_err(|err| err.to_compilation_error(self.heap))
|
||||
Ok(self.heap.push_cell(cell)?)
|
||||
}
|
||||
|
||||
fn term_as_addr(&mut self, term: &TermRef, h: usize) -> HeapCellValue {
|
||||
@@ -475,10 +473,7 @@ impl<'a> TermWriter<'a> {
|
||||
self.push_stub_addr()?;
|
||||
}
|
||||
|
||||
let cell = self
|
||||
.heap
|
||||
.allocate_cstr(src)
|
||||
.map_err(|err| err.to_compilation_error(self.heap))?;
|
||||
let cell = self.heap.allocate_cstr(src)?;
|
||||
|
||||
let new_h = self.heap.cell_len();
|
||||
self.push_cell(cell)?;
|
||||
@@ -496,10 +491,7 @@ impl<'a> TermWriter<'a> {
|
||||
self.push_stub_addr()?;
|
||||
}
|
||||
|
||||
let cell = self
|
||||
.heap
|
||||
.allocate_pstr(src)
|
||||
.map_err(|err| err.to_compilation_error(self.heap))?;
|
||||
let cell = self.heap.allocate_pstr(src)?;
|
||||
|
||||
let tail_h = self.heap.cell_len();
|
||||
self.push_stub_addr()?;
|
||||
|
||||
Reference in New Issue
Block a user