diff --git a/crates/rune/src/modules/string.rs b/crates/rune/src/modules/string.rs index 1ab3c0964..a8b931475 100644 --- a/crates/rune/src/modules/string.rs +++ b/crates/rune/src/modules/string.rs @@ -6,14 +6,13 @@ use core::num::{ParseFloatError, ParseIntError}; use core::str::Utf8Error; use crate as rune; -use crate::alloc::fmt::TryWrite; use crate::alloc::prelude::*; use crate::alloc::string::FromUtf8Error; use crate::alloc::{String, Vec}; use crate::compile::Named; use crate::runtime::{ - Bytes, Formatter, FromValue, Function, MaybeTypeOf, Panic, Ref, ToValue, TypeOf, Value, - ValueKind, VmErrorKind, VmResult, + Bytes, FromValue, Function, MaybeTypeOf, Panic, Ref, ToValue, TypeOf, Value, ValueKind, + VmErrorKind, VmResult, }; use crate::{Any, ContextError, Module}; @@ -96,23 +95,6 @@ pub fn module() -> Result { Ok(m) } -#[derive(Any, Debug, Clone, Copy)] -#[rune(module = crate, item = ::std::string, install_with = NotCharBoundary::install)] -struct NotCharBoundary(()); - -impl NotCharBoundary { - #[rune::function(instance, protocol = STRING_DISPLAY)] - fn string_display(&self, f: &mut Formatter) -> VmResult<()> { - vm_write!(f, "index outside of character boundary"); - VmResult::Ok(()) - } - - fn install(m: &mut Module) -> Result<(), ContextError> { - m.function_meta(Self::string_display)?; - Ok(()) - } -} - /// Converts a vector of bytes to a `String`. /// /// A string ([`String`]) is made of bytes ([`u8`]), and a vector of bytes