Skip to content

Commit

Permalink
rune: Remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Jul 27, 2024
1 parent 42d5607 commit d0e4748
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions crates/rune/src/modules/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -96,23 +95,6 @@ pub fn module() -> Result<Module, ContextError> {
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
Expand Down

0 comments on commit d0e4748

Please sign in to comment.