diff --git a/roc_std/src/lib.rs b/roc_std/src/lib.rs index 7f27585556..f633ed8f40 100644 --- a/roc_std/src/lib.rs +++ b/roc_std/src/lib.rs @@ -2,9 +2,10 @@ #![no_std] use core::convert::From; use core::ffi::c_void; +use core::fmt::{self, Display, Formatter}; use core::mem::{ManuallyDrop, MaybeUninit}; use core::ops::Drop; -use core::{fmt, mem, ptr, slice}; +use core::{mem, ptr, slice}; // A list of C functions that are being imported extern "C" { @@ -674,6 +675,12 @@ impl From<&str> for RocStr { } } +impl Display for RocStr { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + self.as_str().fmt(f) + } +} + impl fmt::Debug for RocStr { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // RocStr { is_small_str: false, storage: Refcounted(3), elements: [ 1,2,3,4] }