1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin: x.vstring() instead of string(x) (#6102)

This commit is contained in:
Delyan Angelov
2020-08-10 19:05:26 +03:00
committed by GitHub
parent eba413853f
commit 36eae1c175
30 changed files with 143 additions and 72 deletions

View File

@@ -70,7 +70,7 @@ fn (mut cb Clipboard) get_text() string {
#}
#utf8_clip = [ns_clip UTF8String];
return string(utf8_clip)
return unsafe { utf8_clip.vstring() }
}
pub fn new_primary() &Clipboard {

View File

@@ -309,7 +309,7 @@ fn (mut cb Clipboard) start_listener(){
C.XDeleteProperty(event.xselection.display, event.xselection.requestor, event.xselection.property)
if cb.is_supported_target(prop.actual_type) {
cb.got_text = true
cb.text = string(prop.data) //TODO: return byteptr to support other mimetypes
cb.text = byteptr(prop.data).vstring() //TODO: return byteptr to support other mimetypes
}
cb.mutex.unlock()
}