Skip to content

Commit 569e08d

Browse files
committed
Updated deprecated raw::from_buf to from_raw_buf
The function string::raw::from_buf was deprecated in favor of String::from_raw_buf. I also removed the now unused using for string.
1 parent 4725175 commit 569e08d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/ncurses.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ extern crate core;
1919
extern crate libc;
2020

2121
use core::mem;
22-
use std::{ string, char, ptr };
22+
use std::{ char, ptr };
2323
use self::ll::{ chtype, FILE_p, mmask_t };
2424
pub use self::constants::*;
2525

@@ -565,7 +565,7 @@ pub fn is_syncok(w: WINDOW) -> bool
565565

566566

567567
pub fn keyname(c: i32) -> String
568-
{ unsafe { string::raw::from_buf(ll::keyname(c) as *const u8) } }
568+
{ unsafe { String::from_raw_buf(ll::keyname(c) as *const u8) } }
569569

570570

571571
pub fn keypad(w: WINDOW, bf: bool) -> i32
@@ -581,7 +581,7 @@ pub fn leaveok(w: WINDOW, bf: bool) -> i32
581581

582582

583583
pub fn longname() -> String
584-
{ unsafe { string::raw::from_buf(ll::longname() as *const u8) } }
584+
{ unsafe { String::from_raw_buf(ll::longname() as *const u8) } }
585585

586586

587587
pub fn meta(w: WINDOW, bf: bool) -> i32
@@ -1125,7 +1125,7 @@ pub fn slk_init(fmt: i32) -> i32
11251125

11261126

11271127
pub fn slk_label(n: i32) -> String
1128-
{ unsafe { string::raw::from_buf(ll::slk_label(n) as *const u8) } }
1128+
{ unsafe { String::from_raw_buf(ll::slk_label(n) as *const u8) } }
11291129

11301130

11311131
pub fn slk_noutrefresh() -> i32
@@ -1177,7 +1177,7 @@ pub fn termattrs() -> u32
11771177

11781178

11791179
pub fn termname() -> String
1180-
{ unsafe { string::raw::from_buf(ll::termname() as *const u8) } }
1180+
{ unsafe { String::from_raw_buf(ll::termname() as *const u8) } }
11811181

11821182

11831183
pub fn timeout(delay: i32)
@@ -1205,11 +1205,11 @@ pub fn tigetnum(capname: &str) -> i32
12051205

12061206

12071207
pub fn tigetstr(capname: &str) -> String
1208-
{ unsafe { { string::raw::from_buf(ll::tigetstr(capname.to_c_str().as_ptr()) as *const u8) } } }
1208+
{ unsafe { { String::from_raw_buf(ll::tigetstr(capname.to_c_str().as_ptr()) as *const u8) } } }
12091209

12101210

12111211
pub fn tparm(s: &str) -> String
1212-
{ unsafe { { string::raw::from_buf(ll::tparm(s.to_c_str().as_ptr()) as *const u8) } } }
1212+
{ unsafe { { String::from_raw_buf(ll::tparm(s.to_c_str().as_ptr()) as *const u8) } } }
12131213

12141214

12151215
pub fn ungetch(ch: i32) -> i32

0 commit comments

Comments
 (0)