chore: import official kitty sources from upstream
Bring the kovidgoyal/kitty codebase in as the base of FWS-Kitty, vendored at upstream commit 91fb38a without its git history.
This commit is contained in:
1134 files changed
+433629
No files matched your search
@@ -0,0 +1,24 @@
|
||||
// License: GPLv3 Copyright: 2023, Kovid Goyal, <kovid at kovidgoyal.net>
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
var _ = fmt.Print
|
||||
|
||||
// Unsafely converts s into a byte slice.
|
||||
// If you modify b, then s will also be modified. This violates the
|
||||
// property that strings are immutable.
|
||||
func UnsafeStringToBytes(s string) (b []byte) {
|
||||
return unsafe.Slice(unsafe.StringData(s), len(s))
|
||||
}
|
||||
|
||||
// Unsafely converts b into a string.
|
||||
// If you modify b, then s will also be modified. This violates the
|
||||
// property that strings are immutable.
|
||||
func UnsafeBytesToString(b []byte) (s string) {
|
||||
return unsafe.String(unsafe.SliceData(b), len(b))
|
||||
}
|
||||
Reference in new issue
Block a user