From 164657caf8ff4b2f09174ac08d7b8bf39bbc9026 Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Mon, 18 Jul 2022 18:46:19 -0700 Subject: [PATCH] Len() -> RuneLength() --- len.go => runelength.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename len.go => runelength.go (55%) diff --git a/len.go b/runelength.go similarity index 55% rename from len.go rename to runelength.go index fed97be..df45ea6 100644 --- a/len.go +++ b/runelength.go @@ -1,31 +1,31 @@ package utf8 -// Len returns the number of bytes in a UTF-8 encoding of this Unicode code point. +// RuneLength returns the number of bytes in a UTF-8 encoding of this Unicode code point. // // Example // -// length := utf8.Len('A') +// length := utf8.RuneLength('A') // // // length == 1 // // Example // -// length := utf8.Len('r') +// length := utf8.RuneLength('r') // // // length == 1 // // Example // -// length := utf8.Len('¡') +// length := utf8.RuneLength('¡') // // // length == 2 // // Example // -// length := utf8.Len('۵') +// length := utf8.RuneLength('۵') // // // length == 2 -func Len(r rune) int { +func RuneLength(r rune) int { switch { case 127 >= r: