mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
Switched from to_strbuf to into_owned
This commit is contained in:
+1
-1
@@ -354,7 +354,7 @@ impl AudioCVT {
|
||||
|
||||
unsafe {
|
||||
if (*self.raw).needed != 1 {
|
||||
return Err("no convertion needed!".to_strbuf())
|
||||
return Err("no convertion needed!".into_owned())
|
||||
}
|
||||
// set len
|
||||
(*self.raw).len = src.len() as c_int;
|
||||
|
||||
+1
-1
@@ -1142,7 +1142,7 @@ pub fn push_event(event: Event) -> SdlResult<()> {
|
||||
else { Err(get_error()) }
|
||||
},
|
||||
None => {
|
||||
Err("Unsupport event type to push back to queue.".to_strbuf())
|
||||
Err("Unsupport event type to push back to queue.".into_owned())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -733,7 +733,7 @@ impl Texture {
|
||||
if result {
|
||||
Ok((texw as f64, texh as f64))
|
||||
} else {
|
||||
Err("Operation not supported".to_strbuf())
|
||||
Err("Operation not supported".into_owned())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ pub fn was_inited(flags: InitFlag) -> InitFlag {
|
||||
pub fn get_error() -> String {
|
||||
unsafe {
|
||||
let cstr = CString::new(ll::SDL_GetError(), false);
|
||||
cstr.as_str().unwrap().to_strbuf()
|
||||
cstr.as_str().unwrap().into_owned()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ pub fn get_version() -> Version {
|
||||
pub fn get_revision() -> String {
|
||||
unsafe {
|
||||
let ret = ll::SDL_GetRevision();
|
||||
CString::new(ret, false).as_str().unwrap().to_strbuf()
|
||||
CString::new(ret, false).as_str().unwrap().into_owned()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user