Removed unused convert::From

This commit is contained in:
Cameron Hart 2016-01-17 00:50:56 +11:00
parent 9bcb3cb0d5
commit 4739953a94

View File

@ -8,7 +8,6 @@ extern crate libc;
use libc::{c_char, c_float, c_int, c_uchar};
use std::borrow::Cow;
use std::convert::From;
use std::ffi::CStr;
use std::mem;
use std::ptr;
@ -93,16 +92,6 @@ impl<'a> ImStr<'a> {
fn as_ptr(&self) -> *const c_char { self.bytes.as_ptr() as *const c_char }
}
impl<'a> From<&'a str> for ImStr<'a> {
fn from(value: &'a str) -> ImStr<'a> {
let mut bytes: Vec<u8> = value.bytes().collect();
bytes.push(0);
ImStr {
bytes: Cow::Owned(bytes)
}
}
}
impl From<String> for ImStr<'static> {
fn from(mut value: String) -> ImStr<'static> {
value.push('\0');