From 3602a0218c5ba3041e5a770de2a7b4033b5ace17 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 21 Mar 2023 16:48:17 -0400 Subject: [PATCH] Fix superscript --- site/posts/2023-02-18-rust-swift.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/posts/2023-02-18-rust-swift.md b/site/posts/2023-02-18-rust-swift.md index cb1a57b..8141f22 100644 --- a/site/posts/2023-02-18-rust-swift.md +++ b/site/posts/2023-02-18-rust-swift.md @@ -37,7 +37,7 @@ let data = Data(buffer: buf) let code = String(data: data, encoding: .utf8)! ``` -You may notice that the code string length is being passed into the function as an unsigned 64-bit integer, and then being converted to an `Int`, which may not be capable of representing the value. But, since this is just a syntax highlighter for my blog, there's absolutely no chance of it ever being used to highlight a string longer than 2^63-1 bytes. +You may notice that the code string length is being passed into the function as an unsigned 64-bit integer, and then being converted to an `Int`, which may not be capable of representing the value. But, since this is just a syntax highlighter for my blog, there's absolutely no chance of it ever being used to highlight a string longer than 263-1 bytes. The actual highlighting I'll skip, you can refer to the documentation for Splash. Once that's done, though, the output needs to be sent back to Rust somehow. Again, since the function signature needs to be compatible with C, it returns a pointer to a byte buffer containing the UTF-8 encoded string. It also sets a length pointer provided by the caller to the length in bytes of the output.