Remove redundant std.

This commit is contained in:
Stephen Chung
2021-04-20 19:19:35 +08:00
parent 0f66c67f82
commit 8ff1f57900
9 changed files with 18 additions and 27 deletions

View File

@@ -4,9 +4,6 @@ use std::ops::Range;
#[cfg(feature = "no_std")]
use std::prelude::v1::*;
#[cfg(not(feature = "unchecked"))]
use std::string::ToString;
#[cfg(not(feature = "unchecked"))]
use num_traits::{CheckedAdd as Add, CheckedSub as Sub};
@@ -209,8 +206,6 @@ def_package!(crate:BasicIteratorPackage:"Basic range iterators.", lib, {
pub fn new(from: Decimal, to: Decimal, step: Decimal) -> Result<Self, Box<EvalAltResult>> {
#[cfg(not(feature = "unchecked"))]
if step.is_zero() {
use std::string::ToString;
return EvalAltResult::ErrorInFunctionCall("range".to_string(), "".to_string(),
Box::new(EvalAltResult::ErrorArithmetic("step value cannot be zero".to_string(), crate::Position::NONE)),
crate::Position::NONE,

View File

@@ -103,7 +103,7 @@ mod print_debug_functions {
)]
pub fn format_array(ctx: NativeCallContext, array: &mut Array) -> ImmutableString {
let len = array.len();
let mut result = std::string::String::with_capacity(len * 5 + 2);
let mut result = String::with_capacity(len * 5 + 2);
result.push_str("[");
array.iter_mut().enumerate().for_each(|(i, x)| {
@@ -130,7 +130,7 @@ mod print_debug_functions {
)]
pub fn format_map(ctx: NativeCallContext, map: &mut Map) -> ImmutableString {
let len = map.len();
let mut result = std::string::String::with_capacity(len * 5 + 3);
let mut result = String::with_capacity(len * 5 + 3);
result.push_str("#{");
map.iter_mut().enumerate().for_each(|(i, (k, v))| {