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:
@@ -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 {
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user