mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-18 17:08:27 +00:00
Removed unused convert::From
This commit is contained in:
parent
9bcb3cb0d5
commit
4739953a94
11
src/lib.rs
11
src/lib.rs
@ -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');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user