mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-20 23:37:56 +03:00
Add Display to RocStr
This commit is contained in:
parent
e216d74948
commit
2b5a660178
@ -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] }
|
||||
|
Loading…
Reference in New Issue
Block a user