From: Markus Triska Date: Sat, 3 Sep 2022 19:25:19 +0000 (+0200) Subject: use newly available u8s_to_string X-Git-Tag: v0.9.1^2~14 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=579aa8acd454426f372d6a839627a07e606641d2;p=scryer-prolog.git use newly available u8s_to_string --- diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index ba78afdc..dd2b5bf4 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -6635,13 +6635,9 @@ impl Machine { } let b64 = base64::encode_config(bytes, config); - let cstr = if b64.len() == 0 { - empty_list_as_cell!() - } else { - atom_as_cstr_cell!(self.machine_st.atom_tbl.build_with(&b64)) - }; + let string = self.u8s_to_string(&b64.as_bytes()); - unify!(self.machine_st, self.machine_st.registers[2], cstr); + unify!(self.machine_st, self.machine_st.registers[2], string); } Ok(())