Returns the current content as a &str. Returns an empty string if the content isn’t valid UTF-8.
(&self)
| 788 | /// Returns the current content as a &str. |
| 789 | /// Returns an empty string if the content isn’t valid UTF-8. |
| 790 | pub fn as_str(&self) -> &str { |
| 791 | core::str::from_utf8(&self.buf[..self.len]).unwrap_or("") |
| 792 | } |
| 793 | } |
| 794 | |
| 795 | impl<const N: usize> Default for FixedCString<N> { |
no outgoing calls