Files
boc/aamos-ledger-rust/target/debug/deps/libcompact_str-9bfac81f080013f7.rmeta
T

3258 lines
362 KiB
Plaintext
Raw Normal View History

rust
¤#rustc 1.96.0 (ac68faa20 2026-05-25)ÁÀ뉊]!ÜÛê(¹Þ—šên-5be7b69c3ff7b5b8ÁíàÄTËŸ ÜJîÄ)'ß\¥!-3d1337db07d0b3aeÁ¤²XctÔ'ÐÓ©z¨ɽÓ-a4945860e1c53b00Á¤°ð ¾ä-±($²ï=©Ã-7e98a21bfd32b0edÁòÖÀH•‘PIÓHã#£-055f30b747f859b6Árustc_std_workspace_coreÁ­Cçß^ò½èÝ$­Çÿ+Cé-c4878ee60b2242c9ÁŸÃï+Ñ]ŠqB<ÏïW#-8dd1dd90e70d0b6aÁ miniz_oxideÁ€š»J(P>àö÷g\K-1eb618da2918ab7fÁadler2ÁÆ;+Þ®5¥Ìýݰ¦ÛLˆ-f7919172d268e069Á hashbrownÁPäV9ÒÆèÜ"ÊÖVŽ\-0fc2184a5da6723aÁrustc_std_workspace_allocÁs&ØòØy¯s•bæ!‰ýŠ-97e4bf30be240674Á
std_detectÁhŠBîÙºÌI®ËÅš-9dbbf8346ba7ac8bÁrustc_demangleÁûë9´Ç×@Œ’ùXFº-f33013f239bf9f14Ácfg_ifÁÜLhž§Œaã¯>­-0a71c8f33a838301Á addr2lineÁ׎Þ!]8V$É@@-e618e6be60e87ba2ÁgimliÁ¸
°µ~Î1‹Ñt ðÁ€w-1f7768a68858f670ÁobjectÁ
áPÃ?­À¶¼QHJ¥-914cd6a4dbe590d1ÁmemchrÁ›º«8Ór­2Ù $¨ûib-cf21ca6f2bb15dcdÁë
‹ás«LÖ€îâƒ×ɯŒ-ee6f3747e38367f0ÁcastawayÁ¼ëîP°½}z#ŽàŸ-cf5029cbfec68998Á rustversionÁTgÌüÁé¨Cå@Ö'G-f0da710c68354185Ástatic_assertionsÁ´m-5q< ¾²ÃëÏÿ-f6f564d31b3b65e5Á®f©¾/ô)c§{õa“â‘-a3906971a93fd1b8ÁitoaÁrLpèòÐ
ݽ‚AéGT'-7ba5a7b63f68a66bÁryuÁ4>ûŸ?·üapƒÈ»å-6eb1932a1aea6cadÁ arbitraryÁL…»æ ¬ibytesÁ,®»
Œ–markupÁ4Ô»Ÿ
”»proptestÁDý»»
¤â
quickcheckÁTª»Ù
´rkyvÁ$Ó»ù
„¼serdeÁ,÷» ŒßsmallvecÁDŸ»® ¤„testsÁ,ü 
,p»
ŒX® »® ¤}%Ì , &$•&4$…~$ú}lÌ ~Ì ,¼&$±&¢Ì ,Üd$ÑdÆÌ Ì ,«Ï$ Ï«Ì ,Ö0 $Ë0 Ì ,
$‡
À 
  
featuresÁmacrosÁformat_compactÁ capacityÁ%%
USIZE_SIZEÁ%CAP_ON_HEAP_FLAGÁ( ( %CAPACITY_IS_ON_THE_HEAPÁ+ %SPACE_FOR_CAPACITYÁ% MAX_VALUEÁ%/æ /as_usizeÁ1 /is_heapÁheapÁ444444444
MIN_HEAP_SIZEÁ4UNKNOWNÁ4 StrBufferÁ? 4amortized_growthÁ4
HeapBufferÁBµ BBcapÁ4Fæ F
with_capacityÁFwith_additionalÁFýJread_capacity_from_heapÁK Fã Fset_lenÁF˜4Pƒ4Rã4 allocate_ptrÁTallocate_with_capacity_on_heapÁ4deallocate_ptrÁV deallocate_with_capacity_on_heapÁW 4
heap_capacityÁYYYY¤Y˜YHeapBufferInnerHeapCapacityÁ_ý_bufferÁYlayoutÁ4inline_capacityÁcccc¤c˜cHeapBufferInnerInlineCapacityÁi·cÄÝllllll InlineBufferÁr
rˆt lvæ w v new_constÁy vemptyÁv½væù~~~~~~~~ù¥~'aÁù¥~from_as_ref_str_iteratorÁ¤š~éù¥~ù¥~ù˜¥~šù¥~éùŸ¥nonmaxÁnumÁ¢¢¢¢¢¢¢DEC_DIGITS_LUTÁ¢
impl_IntoReprÁ¢« into_reprÁ¢­¢impl_NonZero_IntoReprÁ¢NumCharsÁ° num_charsÁ¢²Ö¢´Ö¢Ö¢¸Ö¢ºÖ¢¼Ö¢¾Ö¢ ÀÖ¢
ÂÖ¢ ÄÖtraitsÁÆÆFALSEÁÆTRUEÁÆIntoReprÁÊÆÌÆÎÆÐÆÒÓ  MAX_SIZEÁ HEAP_MASKÁ LENGTH_MASKÁEMPTYÁReprÁÞ
ÞˆÞÞŠÞÞŒÞèæ è
new_inlineÁèãè from_utf8Áìèfrom_utf8_uncheckedÁîè from_stringÁðcapacity_on_heapÁðè into_stringÁóinto_string_heapÁèreserveÁè shrink_toÁèpush_strÁèpopÁèas_sliceÁèas_strÁèèýüàèis_heap_allocatedÁè
as_mut_bufÁè½è last_byteÁè from_inlineÁè from_heapÁè into_heapÁè as_mut_heapÁèas_heapÁè
as_mut_inlineÁè as_inlineÁƒŠ
clone_heapÁŒã
outlined_dropÁextendÁ¥  é³!¥˜é˜³!š¥š ³!ž¥ž  ¡é¡³!£¥£ 
¦³!§¥§ è«««««««««« «
«ToCompactStringÁ·to_compact_stringÁ«««»¥»¼#«CompactStringExtÁ¾concat_compactÁ¾ join_compactÁÀ¤«ÂšÂÂéÂŒ$Æ Â¢$È¤Íæ Υ͊ÍãͤÒͽÔÍ
from_utf16ÁÖÍfrom_utf16_lossyÁØÍÍis_emptyÁÍý;ÍÍ
as_mut_strÁÍas_bytesÁÍ as_mut_bytesÁÍpushÁâ ÍîÍÞÍremoveÁÍ½Í¯Í ensure_rangeÁéimpl RangeBounds<usize>Áé
illegal_rangeÁÍ
replace_rangeÁì»'Íreplace_range_same_sizeÁÍreplace_range_shrinkÁÍreplace_range_growÁÍtruncateÁÍas_ptrÁÍ
as_mut_ptrÁÍ
insert_strÁÍinsertÁõ ÍclearÁÍ split_offÁÍdrainÁù»'ÍÍÍ
shrink_to_fitÁÍretainÁýimpl FnMut(char) -> boolÁÍfrom_utf8_lossyÁÿ next_charÁé  REPLACEMENTÁ§' ensure_contÁÿ Í from_utf16xÁimpl Fn(u16) -> u16Áimpl Fn([u8; 2]) -> u16Á   Ífrom_utf16x_lossyÁ¯+Ê+ Í from_utf16leÁimpl AsRef<[u8]>ÁÍ from_utf16beÁº,Ífrom_utf16le_lossyÁº,Ífrom_utf16be_lossyÁº,ÍÍfrom_string_bufferÁ>å´ ¢É¤É¦É¨borrowÁª
borrow_mutÁ 
­¥­ ° ²
´é´·¹ï
»§¼¾é¾÷Á÷ÃéÃ÷ÆéÆ÷É÷Ë÷Í÷ÏéÏ÷ÒÒþÕ×××ÙùÚ¥ÜéÜùÞ¥àéàùâ¥äùå¥ çéçùé¥!ëùì¥"îùï¥#ñùò¥$ôùõ¥%÷³!ø¥&úéú³!ü¥'þéþ³!¥(³!ƒ¥)é³!¥ *г!¥+³!Ž¥,³!¥-é³!¥.ñï/š°š01Ÿ×DrainÁ¡é¡compact_stringÁ¡¹¡þ¡charsÁ234©×5«×6­ã7¯8±å±´9´´ó ´ü´ size_hintÁ´:º next_backÁ;%CapacityÁ½
½ˆ¿ %%%ÃƒÄ %Æ×%%É%ËÖÌ %Î %Ð ÑÑ Ñ 4Õ l× ¡NonMaxU8ÁÙV0ÁÚ
Ú ÙV1ÁÝ
Ý ÙV2Áà
à ÙV3Áã
ã ÙV4Áæ
æ ÙV5Áé
é ÙV6Áì
ì ÙV7Áï
ï ÙV8Áò
ò ÙV9Áõ
õ ÙV10Áø
ø ÙV11Áû
û ÙV12Áþ
þ ÙV13Á
 ÙV14Á
 ÙV15Á
 ÙV16ÁŠ
Š ÙV17Á
 ÙV18Á
 ÙV19Á
 ÙV20Á
 ÙV21Á
 ÙV22Áœ
œ ÙV23ÁŸ
Ÿ ÙV24Á¢
¢ ÙV25Á¥
¥ ÙV26Á¨
¨ ÙV27Á«
« ÙV28Á®
® ÙV29Á±
± ÙV30Á´
´ ÙV31Á·
· ÙV32Áº
º ÙV33Á½
½ ÙV34ÁÀ
À ÙV35ÁÃ
à ÙV36ÁÆ
Æ ÙV37ÁÉ
É ÙV38ÁÌ
Ì ÙV39ÁÏ
Ï ÙV40ÁÒ
Ò ÙV41ÁÕ
Õ ÙV42ÁØ
Ø ÙV43ÁÛ
Û ÙV44ÁÞ
Þ ÙV45Áá
á ÙV46Áä
ä ÙV47Áç
ç ÙV48Áê
ê ÙV49Áí
í ÙV50Áð
ð ÙV51Áó
ó ÙV52Áö
ö ÙV53Áù
ù ÙV54Áü
ü ÙV55Áÿ
ÿ ÙV56Á
 ÙV57Á
 ÙV58Áˆ
ˆ ÙV59Á
 ÙV60ÁŽ
Ž ÙV61Á
 ÙV62Á
 ÙV63Á
 ÙV64Áš
š ÙV65Á
 ÙV66Á 
  ÙV67Á£
£ ÙV68Á¦
¦ ÙV69Á©
© ÙV70Á¬
¬ ÙV71Á¯
¯ ÙV72Á²
² ÙV73Áµ
µ ÙV74Á¸
¸ ÙV75Á»
» ÙV76Á¾
¾ ÙV77ÁÁ
Á ÙV78ÁÄ
Ä ÙV79ÁÇ
Ç ÙV80ÁÊ
Ê ÙV81ÁÍ
Í ÙV82ÁÐ
Ð ÙV83ÁÓ
Ó ÙV84ÁÖ
Ö ÙV85ÁÙ
Ù ÙV86ÁÜ
Ü ÙV87Áß
ß ÙV88Áâ
â ÙV89Áå
å ÙV90Áè
è ÙV91Áë
ë ÙV92Áî
î ÙV93Áñ
ñ ÙV94Áô
ô ÙV95Á÷
÷ ÙV96Áú
ú ÙV97Áý
ý ÙV98Á
 ÙV99Áƒ
ƒ ÙV100Á
 ÙV101Á
 ÙV102ÁŒ
Œ ÙV103Á
 ÙV104Á
 ÙV105Á
 ÙV106Á˜
˜ ÙV107Á
 ÙV108Áž
ž ÙV109Á¡
¡ ÙV110Á¤
¤ ÙV111Á§
§ ÙV112Áª
ª ÙV113Á­
­ ÙV114Á°
° ÙV115Á³
³ ÙV116Á
 ÙV117Á¹
¹ ÙV118Á¼
¼ ÙV119Á¿
¿ ÙV120ÁÂ
 ÙV121ÁÅ
Å ÙV122ÁÈ
È ÙV123ÁË
Ë ÙV124ÁÎ
Î ÙV125ÁÑ
Ñ ÙV126ÁÔ
Ô ÙV127Á×
× ÙV128ÁÚ
Ú ÙV129ÁÝ
Ý ÙV130Áà
à ÙV131Áã
ã ÙV132Áæ
æ ÙV133Áé
é ÙV134Áì
ì ÙV135Áï
ï ÙV136Áò
ò ÙV137Áõ
õ ÙV138Áø
ø ÙV139Áû
û ÙV140Áþ
þ ÙV141Á
 ÙV142Á
 ÙV143Á
 ÙV144ÁŠ
Š ÙV145Á
 ÙV146Á
 ÙV147Á
 ÙV148Á
 ÙV149Á
 ÙV150Áœ
œ ÙV151ÁŸ
Ÿ ÙV152Á¢
¢ ÙV153Á¥
¥ ÙV154Á¨
¨ ÙV155Á«
« ÙV156Á®
® ÙV157Á±
± ÙV158Á´
´ ÙV159Á·
· ÙV160Áº
º ÙV161Á½
½ ÙV162ÁÀ
À ÙV163ÁÃ
à ÙV164ÁÆ
Æ ÙV165ÁÉ
É ÙV166ÁÌ
Ì ÙV167ÁÏ
Ï ÙV168ÁÒ
Ò ÙV169ÁÕ
Õ ÙV170ÁØ
Ø ÙV171ÁÛ
Û ÙV172ÁÞ
Þ ÙV173Áá
á ÙV174Áä
ä ÙV175Áç
ç ÙV176Áê
ê ÙV177Áí
í ÙV178Áð
ð ÙV179Áó
ó ÙV180Áö
ö ÙV181Áù
ù ÙV182Áü
ü ÙV183Áÿ
ÿ ÙV184Á
 ÙV185Á
 ÙV186Áˆ
ˆ ÙV187Á
 ÙV188ÁŽ
Ž ÙV189Á
 ÙV190Á
 ÙV191Á
 ÙV192Áš
š ÙV193Á
 ÙV194Á 
  ÙV195Á£
£ ÙV196Á¦
¦ ÙV197Á©
© ÙV198Á¬
¬ ÙV199Á¯
¯ ÙV200Á²
² ÙV201Áµ
µ ÙV202Á¸
¸ ÙV203Á»
» ÙV204Á¾
¾ ÙV205ÁÁ
Á ÙV206ÁÄ
Ä ÙV207ÁÇ
Ç ÙV208ÁÊ
Ê ÙV209ÁÍ
Í ÙV210ÁÐ
Ð ÙV211ÁÓ
Ó ÙV212ÁÖ
Ö ÙV213ÁÙ
Ù ÙV214ÁÜ
Ü ÙV215Áß
ß ÙV216Áâ
â ÙV217Áå
å ÙV218Áè
è ÙV219Áë
ë ÙV220Áî
î ÙV221Áñ
ñ ÙV222Áô
ô ÙV223Á÷
÷ ÙV224Áú
ú ÙV225Áý
ý ÙV226Á

ÙV227Áƒ
ƒ
ÙV228Á

ÙV229Á

ÙV230ÁŒ
Œ
ÙV231Á

ÙV232Á

ÙV233Á

ÙV234Á˜
˜
ÙV235Á

ÙV236Áž
ž
ÙV237Á¡
¡
ÙV238Á¤
¤
ÙV239Á§
§
ÙV240Áª
ª
ÙV241Á­
­
ÙV242Á°
°
ÙV243Á³
³
ÙV244Á

ÙV245Á¹
¹
ÙV246Á¼
¼
ÙV247Á¿
¿
ÙV248ÁÂ
Â
ÙV249ÁÅ
Å
ÙV250ÁÈ
È
ÙV251ÁË
Ë
ÙV252ÁÎ
Î
ÙV253ÁÑ
Ñ
ÙV254ÁÔ
Ô
¡¡¡Ù
ƒ¡Û
סÝ
¢ ß
¢
á
¢ã
¢å
¢ç
¢é
¢ë
¢í
¢ï
¢ñ
¢ó
¢õ
¢÷
¢ù
¢û
¢ý
¢ÿ
¢ ¢ƒ ¢ ¢  ¢! ½½½½½½½½½½ ½
½ ½ ½
½½½½½½½½½½½½½½½½
CompactStringÁ©
© ˆ<¬ ƒ
Utf16ErrorÁ®
® ˆ=>?³ ƒ@µ ×· 1
3
G
I
J
K
M
N
O
Q
S
w
y
|
}
é
ê
õ
ö
÷
÷
ø
ù
ú
û
ü
ý
þ
ÿ





ˆ
Š


Ž


š
ž
£
§
¸
½
¿
À
Æ
È
Ð
Ú
Û
Ü
Ý
Þ
ß
à
á
â
ä
å
å
æ
ç
è
é
ì
ì
î
î
ï
ï
ð
ð
ñ
ò
ó
ô
ô
õ
÷
ø
ù
û
ü
ý
ÿ




Ÿ
¡
£
¥
§
©
«
¯
¯
±
±
²
³
³


¸
¸
º
º
¼
¼
Í
Ô
Ö
Ö
Ö
Ø
Ø
Ø
ô
ø
ü

ƒ


Ž


˜
˜


š
œ

ž
ž
 
 
 
§
¨
©
ª
ª
ª
«
¬
¬
¬
­
®
¯
°
±
³
´

¸
º
»
¼
Ä
Ç
Ç
Ç
Ê
Ê
Ì
Ú
Ü
Ü
Ü
­
´



°Ê·¾Š ½½¾«6¿ˆ%  j{;ŸÛÀoØÀo¿cÀoÐìÀoµßÀoÀoÀoØBB¯Cµ DEν÷òf÷-Œ"ºpÃLÞÞßµàˆáâŠãäŒå Þz‡e`¾æÃLƒq éÃLƒq éÃLƒqžBoxÁ¡ˆˆ¢ˆl }.xÏçEçEèEGlobalÁ ¿±‡§í#ÃLƒqúHúHßûHÁ‘4Ý­f‰úM÷ÃLƒq© © ª ½f« ˆ Ëω“~û*ÚÃLƒq»¾¿BorrowedÁÀˆÁÂOwnedÁÈ¢ÓÛ?'°UFéŠ ÙÿÚÛÞ7ÜÝÞò7ßàá†8âãäš8åæç®8èéêÂ8ëìíÖ8îïðê8ñòóþ8ôõö’9÷øù¦9úûü»9ýþÿÐ9å9ƒú9ˆ:Ф:ŒŽ¹:Î:ã:ø:˜š;œ¢;žŸ ·;¡¢£Ì;¤¥¦á;§¨©ö;ª«¬‹<­®¯ <°±²µ<³´µÊ<·¸ß<¹º»ô<¼½¾‰=¿ÀÁž=ÂÃij=ÅÆÇÈ=ÈÉÊÝ=ËÌÍò=ÎÏЇ>ÑÒÓœ>ÔÕÖ±>×ØÙÆ>ÚÛÜÛ>ÝÞßð>àáâ…?ãäåš?æçè¯?éêëÄ?ìíîÙ?ïðñî?òóôƒ@õö÷˜@øùú­@ûüýÂ@þÿ×@ƒì@Aˆ–AŠŒ«AŽÀAÕAêA˜ÿAš”Bœž©BŸ ¡¾B¢£¤ÓB¥¦§èB¨©ªýB«¬­’C®¯°§C±²³¼C´µÑC·¸¹æCº»¼ûC½¾¿DÀÁÂ¥DÃÄźDÆÇÈÏDÉÊËäDÌÍÎùDÏÐÑŽEÒÓÔ£EÕÖ׸EØÙÚÍEÛÜÝâEÞßà÷EáâãŒFäåæ¡Fçèé¶FêëìËFíîïàFðñòõFóôõŠGö÷øŸGùúû´GüýþÉGÿÞGƒóGˆHˆŠžHŒ´HŽÊHàHöH˜ŒIšœ¢IžŸ¸I ¡¢ÎI£¤¥äI¦§¨úI©ª«J¬­®¦J¯°±¼J²³´ÒJµ·èJ¸¹ºþJ»¼½”K¾¿ÀªKÁÂÃÀKÄÅÆÖKÇÈÉìKÊËÌ‚LÍÎϘLÐÑÒ®LÓÔÕÄLÖרÚLÙÚÛðLÜÝÞ†MßàáœMâãä²MåæçÈMèéêÞMëìíôMîïðŠNñòó Nôõö¶N÷øùÌNúûüâNýþÿøNŽOƒ¤OˆºOŠÐOŒŽæOüO’P¨P˜š¾PœÔPžŸ êP¡¢£€Q¤¥¦–Q§¨©¬Qª«¬ÂQ­®¯ØQ°±²îQ³´µ„R·¸šR¹º»°R¼½¾ÆR¿ÀÁÜRÂÃÄòRÅÆÇˆSÈÉÊžSËÌÍ´SÎÏÐÊSÑÒÓàSÔÕÖöS×ØÙŒTÚÛÜ¢TÝÞ߸TàáâÎTãäåäTæçèúTéêëUìíî¦Uïðñ¼UòóôÒUõö÷èUøùúþUûüý”VþÿªV ƒ ÀVÖVˆ ìVŠ

Ü]
ƒ

ò]

ˆ^ˆ
Š
ž^
Œ

´^Ž

Ê^

à^

ö^
˜

Œ_š
œ
¢_
ž
Ÿ
¸_ 
¡
¢
Î_£
¤
¥
ä_¦
§
¨
ú_©
ª
«
`¬
­
®
¦`¯
°
±
¼`²
³
´
Ò`µ
·
è`¸
¹
º
þ`»
¼
½
”a¾
¿
À
ªaÁ
Â
Ã
ÀaÄ
Å
Æ
ÖaÇ
È
É
ìaÊ
Ë
Ì
bÍ
Î
Ï
˜bÐ
Ñ
Ò
®bÓ
Ô
Õ
ÄbÖ
ìº-Ï6:mÛítØít¿cítÊÊÊÊÊÊÊÊÊÊÊÊÊô ô õ ¨÷ ˆÐ  mjçítoéÊô ô õ ¨÷ ˆÐ  mjçítoéÊô ô õ ¨÷ ˆÐ  mjçítoéÊô ô õ ¨÷ ˆÐ  mjçítoéÊô ô õ ¨÷ ˆÐ  mjçítoéÊô ô õ ¨÷ ˆÐ  mjçítoéÊô ô õ ¨÷ ˆÐ  mjçítoéÊô ô õ ¨÷ ˆÐ  mjçítoéÊô ô õ ¨÷ ˆÐ  mjçítoéÊô ô õ ¨÷ ˆÐ  mjçítoéÊô ô õ ¨÷ ˆÐ  mjçítoéÊô ô õ ¨÷ ˆÐ  mjçítoé°°°°°°°°°°ÊÊÊÊÌìƒq ƒq؃qŒ"ƒqÐLƒqÐLƒq÷qÐLƒqŠrÐLƒqrÐLƒq‰tÐLƒqsZÎsZƒq·¥¾ØÎs³Îsé!Îsö!ÎsàÎsàÎsˆˆOsStrÁinnerÁë//˜þÑ/üàÎs
 Îs£ÎsÎsµßÎsô¡µß–sÎsµß 8Îsµß‰tÎsºÎsíßÎsÎsšeÎséÎsŠréÎs–séÎs é–séÎs‰téÎsré–sÎs黾¿—sÀˆÁ¸sÈ¢ÓÛ?'°UF8Îsé‰t éÎsïyÎs¿cÎsÄcÎsÃLÎsÃLÎs÷qÃLÎsŠrÃLÎsrÃLÎs‰tÃLÎs–sÃLÎsÎsÃL–sÎsÃLé¤ÎsÐLÎsÐLÎs÷qÐLÎsŠrÐLÎsrÐLÎs‰tÐLÎs–sÐL–sÎsÐLÎsÎsÐL‰tÎsêbÎsÄ ÎsÒ£ÙõÎsÒ£Š ® ® ¯ êf° ˆ œ«ñâÖ½#Û„¨Ø„¨¿c„¨Äc„¨Ìì¡¡Ê4£ß4¤¹¥þ¦…5²°AT¬¥ 8 騿cé¨Äc騌"é¨é!é¨ùM騌Mé¨òPé¨Á½×
Ù± ® ½Ø
Ù² ® ýP
ÙÞ¬ © ³ ® ƽÛ
ÙÕ© µ ® ©¡È½É½­© °úH²
´»Ë½¬© RÞ­¡ÞÞÞÞÞšÞÞÙ© Ü© à© ä© ç© ë© î© ñúHô»ß
á
ã
å
ç
é
ë
í
ï
ñ
«­ó
ô õ
ô ÷
ô ù
ô û
ô ý
ô ÿ
ô ô ƒ ô … ô ‡ ô ‰ ô ÌÎÐÒ²´¸º¼¾ÀÂÄæÞ§¡çÞ¨¡ÞÞ˜ÞÞ¡Þ¦Þ÷© ú© þ© © © Š© úH© »¹© ºÞ»Â© © ±¡ © ¢© ¤© ¦© ¨© ª© ·© ¹© »© ¾© Á© é Æ© É© ËúHͻϻҩ ש Ÿ® «¡© š© © ´¡º¡¼¡Š íÛØ¿c(Ðì#µß!Œ"ÃLÊp°
¢Ìì2 ÐLZi·¾³é!ö!à £ºíßšeéïy8ÄcêbÄ ÙõùMŒMòPì\
Ü\
À"üB8',T"Œ¿Àÿ' è4 1'/b¤Ö$ .üÖ Û ö (üƼü°R„åÛµ^:EÛflagÁaV'a'·Û
')$/6:'
USIZE_SIZEÁ
'*$/6:'
USIZE_SIZEÁ” 
 „ 
( üîE+Ûµ%T
',$/6:'
USIZE_SIZEÁtT' Ž. 1'/\üß1-ƒ¶,'œ'üÏ)ìÚÌÚ”Ú-( öF #hC
Ö
‹Ö°üÖ" ÷üÏ- û% 'KKü²K.VUUhƒ¶ªOc-
'À%07;'
USIZE_SIZEÁ^f'sÅŒ'
USIZE_SIZEÁºÂ'ÏÍÝèïó'
USIZE_SIZEÁùê P  Ï* ë ùÚ aÎúÀ!ã ÏÝÀ>ùÿó  ÑÝÀ$úÀ ùïÐúÀ!øÑÝÀz?Ó

 yÓ

Ê(.Ô<GN{ _ }Áº

 qº

ÊÀo(.Ó<GN{ _ }Á
ù¤ST ñ§S 
ÉÔS ¬ï.6 ƒíS   ìS 
ùÆS2 
ÈJž¤
«°
àW' 
ÍøS   ÷S 
  ´¨
 
œÖ 2 ½ üÖ!
ìÖ 
ÜÖͲ %2   öT   'z
 K üÐ(

% 
/
üÐ4
Û 
|– ½ ¤ ïð0üŒä
ü˜ØÀoDöòÎËËäÛµîî®­ƒ¶¿7ÛµÔýr
6ª.Û
'2$/6:'
USIZE_SIZEÁ¼ø
¬øͲ%üí"Ú !Ú? ŽüÐ@=¥ƒ¶3ƒÚŽÚUNKNOWNÁùê P  ÖÝÀ#úÀ ë ùÚ aÕúÀ!ã ÖÝÀx>¼º
 ¬ºͲ%L2=D{ _ }Á¼‰]
 ¬‰]Ͳ%X2=D{ _ }Á
Úu%07;ÚMAX_SIZEÁù*ê P  ØÝÀ#úÀù*Ú a×úÀ!*ã ØÝÀx>D 
Úx%07;ÚMAX_SIZEÁüý r¬€ T€ $€ 
$ 
×|1,…  WD Ús ù2@#ù3ž"# 
ù…ž"#
¶cü« 86»Æ
AP
Wá2#
ÜW cuï 
 î ý 
  

 ˆ
Ô 1
,ˆ

Œ
 T

 ©


ó


 û


Ú î
5 2Ú0d¤Ü
$ .üÜ
. 

\ÿ
Ü 
Š
 
à|3 ü,‹
ü T   ¦ ª=
$ Ï Ó= ' cKŒ  ° Á  !  Å= ! '
c!K "$ ".ܺ  Ô Õ# è$ #'J#ü¬H ó|
 Sø† T% <%B ó4'' ¤þ r' '  
˜yüÈ Ðüù Ÿü—
üãµü‡(rrsÎtˆ ¬}Cq#Âz »Æ ¼ºº»Æ»ü– Yù2Üì#^äÈäÈ ArgumentsÁæÈtemplateÁ `çÈÀ `üöMõô]Td©»ÆíÉɨƒ¶±E ‡£Ú»ÆÛšxŠŠIIIƒ¶Zjq»»ƒ¶Ì[ƒ¶÷qy¸âZtextÁ¥5
·ò ®ã¸´sJ-Ú·ÚÃÚÜ

Úz%07;ÚMAX_SIZEÁ»Æ!œ…
 |…
yK%  ž{üÞ@Úà»Æ»Æ( 
10Á 11Á 12Á
13Á14Á15Á16Á17Á18Á19Á20Á21Á22Á23Á24Á25Á26Á27Á28Á29Á30Á31Á 32Á!33Á"34Á#35Á$36Á%37Á&38Á'39Á(40Á)41Á*42Á+43Á,44Á-45Á.46Á/47Á048Á149Á250Á351Á452Á553Á654Á755Á856Á957Á:58Á;59Á<60Á=61Á>62Á?63Á@64ÁA65ÁB66ÁC67ÁD68ÁE69ÁF70ÁG71ÁH72ÁI73ÁJ74ÁK75ÁL76ÁM77ÁN78ÁO79ÁP80ÁQ81ÁR82ÁS83ÁT84ÁU85ÁV86ÁW87ÁX88ÁY89ÁZ90Á[91Á\92Á]93Á^94Á_95Á`96Áa97Áb98Ác99Ád100Áe101Áf102Ág103Áh104Ái105Áj106Ák107Ál108Ám109Án110Áo111Áp112Áq113Ár114Ás115Át116Áu117Áv118Áw119Áx120Áy121Áz122Á{123Á|124Á}125Á~126Á127Á128Á129Á130Áƒ131Á132Á133Á134Á135Áˆ136Á137ÁŠ138Á139ÁŒ140Á141ÁŽ142Á143Á144Á145Á146Á147Á148Á149Á150Á151Á˜152Á153Áš154Á155Áœ156Á157Áž158ÁŸ159Á 160Á¡161Á¢162Á£163Á¤164Á¥165Á¦166Á§167Á¨168Á©169Áª170Á«171Á¬172Á­173Á®174Á¯175Á°176Á±177Á²178Á³179Á´180Áµ181Á182Á·183Á¸184Á¹185Áº186Á»187Á¼188Á½189Á¾190Á¿191ÁÀ192ÁÁ193ÁÂ194ÁÃ195ÁÄ196ÁÅ197ÁÆ198ÁÇ199ÁÈ200ÁÉ201ÁÊ202ÁË203ÁÌ204ÁÍ205ÁÎ206ÁÏ207ÁÐ208ÁÑ209ÁÒ210ÁÓ211ÁÔ212ÁÕ213ÁÖ214Á×215ÁØ216ÁÙ217ÁÚ218ÁÛ219ÁÜ220ÁÝ221ÁÞ222Áß223Áà224Áá225Áâ226Áã227Áä228Áå229Áæ230Áç231Áè232Áé233Áê234Áë235Áì236Áí237Áî238Áï239Áð240Áñ241Áò242Áó243Áô244Áõ245Áö246Á÷247Áø248Áù249Áú250Áû251Áü252Áý253Áþ254Áù;ê P  Þ
ÝÀ#úÀù;Ú aÝ
úÀ!;ã Þ
ÝÀx>ü÷ó
 È7Döâ éüÙ©öâñ…ñ…7ób"\
0001020304050607080910111213141516171819\
2021222324252627282930313233343536373839\
4041424344454647484950515253545556575859\
6061626364656667686970717273747576777879\
8081828384858687888990919293949596979899"Á<7
»Æ Ì&
„&
êI$ >ü.ȃq$»Æˆ»Æ34e
»Æ ÄT
„T±‰G" küA,Ƀq$M»Æ»ÆŽ3ì·
 Ü·
À–s$ü›:Ú%þ
0b11111110ÁÀ
0b11000000Áþ»Æ!¤í
 „í±‰J$ üÙ)݃q»ÆŒ»Æ5³
 ¾Ô1 ÂÑÚ7 ß$”ìü
 ¼üÎæ1$ ˜̧
 Τ
1& ¿ É È Îϼùr@# ùsž"#  
ù”ž"#œÕüåXV»Æ
=L
Sár#ÓÕ ] oêüù
Öü¯ üï[
ƒq»Æ$‘»ÆÇÇÚà»ÆŒÚàPüÐyùrÜì#ÿÑáü®ãkuÝå¹Ú4ít 
 ƒ‘ ‰‘Š‘üþŒüÿŽ›Ž ƒq,‘Žít¢ít!âÆ^4Æ• 䱕 ƒq ̕Օü¨”­ƒq$Ö”Úà4½”ÚàgÝ:$ƒš Ôî™ ƒq ‡ššƒüƒq$–™ºp$ºpe·8$ž Ô­ž ºp ƞ͞üõXºpT˜žƒq$žƒqd6´Þ2
$ï2

$„Þ2
±‰/? ó2
üÐ2%
©  ô2
û2
Ðüš2a
Îs$Á2
»Æ$²2
ƒq»Æ®ã>¬ø¤
Tø¤
 Ȯ"8
?DĴ
ÕÙJTƒ¥
b δ
 üݤ1
ƒöâ,ð¤
ö⯻Ʈ»Æ@ùäê P  ¸ ÝÀ$úÀ äë ùäÚ a· úÀã ¸ ÝÀ|@œÖ ½¾%Ào0Ûµ8?¼² rs#Úà/¸â7>| Þ'ß4ƒq? HOV]dítkrÄ«
© ª %Îs0ƒq7>¬ÇÌ
® ¯ &„¨29@«¡© ª ® ¯ · Àí$f
Y4„
 ZL
£®D­
¿ßŽ
še Ž e 4×
¢e

ÃL AddÁ
Ä 
AddAssignÁLž
ÙõBoundÁ,­
ç£r,¸
é!DerefMutÁDÃ
ö! RangeBoundsÁ\Ñ
¤#FromStrÁ<ö
ïy Utf8ErrorÁLƒ
ÅÏס
 `ž
‰foÅ
»Ï¡
ˆ
FusedIteratorÁlî
òP͵
Þªô#„Ö
¾Ë¥#|ì
·Ìü³ß
øÉ] ü&
É]<div align="center">
<h1><code>compact_str</code></h1>
<p><strong>A memory efficient string type that can store up to 24* bytes on the stack.</strong></p>
<a href="https://crates.io/crates/compact_str">
<img alt="version on crates.io" src="https://img.shields.io/crates/v/compact_str"/>
</a>
<img alt="Minimum supported Rust Version: 1.57" src="https://img.shields.io/badge/MSRV-1.57-blueviolet">
<a href="LICENSE">
<img alt="mit license" src="https://img.shields.io/crates/l/compact_str"/>
</a>
<br />
<a href="https://github.com/ParkMyCar/compact_str/actions/workflows/ci.yml">
<img alt="Continuous Integration Status" src="https://github.com/ParkMyCar/compact_str/actions/workflows/ci.yml/badge.svg?branch=main&event=push"/>
</a>
<a href="https://github.com/ParkMyCar/compact_str/actions/workflows/cross_platform.yml">
<img alt="Cross Platform Status" src="https://github.com/ParkMyCar/compact_str/actions/workflows/cross_platform.yml/badge.svg?branch=main&event=push"/>
</a>
<a href="https://github.com/ParkMyCar/compact_str/actions/workflows/msrv.yml">
<img alt="Minimum Supported Rust Version Status" src="https://github.com/ParkMyCar/compact_str/actions/workflows/msrv.yml/badge.svg?branch=main&event=push"/>
</a>
<a href="https://github.com/ParkMyCar/compact_str/actions/workflows/clippy.yml">
<img alt="Clippy Status" src="https://github.com/ParkMyCar/compact_str/actions/workflows/clippy.yml/badge.svg?branch=main&event=push"/>
</a>
<p align=right><sub>* 12 bytes for 32-bit architectures</sub></p>
</div>
<br />
### About
A `CompactString` is a more memory efficient string type, that can store smaller strings on the stack, and transparently stores longer strings on the heap (aka a small string optimization).
It can mostly be used as a drop in replacement for `String` and are particularly useful in parsing, deserializing, or any other application where you may
have smaller strings.
### Properties
A `CompactString` specifically has the following properties:
* `size_of::<CompactString>() == size_of::<String>()`
* Stores up to 24 bytes on the stack
* 12 bytes if running on a 32 bit architecture
* Strings longer than 24 bytes are stored on the heap
* `Clone` is `O(n)`
* `From<String>` or `From<Box<str>>` re-uses underlying buffer
* Eagerly inlines small strings
* Heap based string grows at a rate of 1.5x
* The std library `String` grows at a rate of 2x
* Space optimized for `Option<_>`
* `size_of::<CompactString>() == size_of::<Option<CompactString>>()`
* Uses [branchless instructions](https://en.algorithmica.org/hpc/pipelining/branchless/) for string accesses
### Traits
This crate exposes two traits, `ToCompactString` and `CompactStringExt`.
#### `ToCompactString`
Provides the `to_compact_string(&self)` method for converting types into a `CompactString`. This trait is automatically implemented for all types that are `std::fmt::Display`, with specialized higher performance impls for:
* `u8`, `u16`, `u32`, `u64`, `usize`, `u128`
* `i8`, `i16`, `i32`, `i64`, `isize`, `i128`
* `f32`, `f64`
* `bool`, `char`
* `NonZeroU*`, `NonZeroI*`
* `String`, `CompactString`
#### `CompactStringExt`
Provides two methods `join_compact(seperator: impl AsRef<str>)` and `concat_compact()`. This trait is automatically implemented for all types that can be converted into an iterator and yield types that `impl AsRef<str>`. This allows you to join Vec's, slices, and any other collection to form `CompactString`s.
### Macros
This crate exposes one macro `format_compact!` that can be used to create `CompactString`s from arguments, like you can `String`s with the `std::format!` macro.
### Features
`compact_str` has the following optional features:
* `serde`, which implements [`Deserialize`](https://docs.rs/serde/1/serde/trait.Deserialize.html) and [`Serialize`](https://docs.rs/serde/1/serde/trait.Serialize.html) from the popular [`serde`](https://docs.rs/serde/1/serde/) crate, for `CompactString`
* `bytes`, which provides two methods `from_utf8_buf<B: Buf>(buf: &mut B)` and `from_utf8_buf_unchecked<B: Buf>(buf: &mut B)`, which allows for the creation of a `CompactString` from a [`bytes::Buf`](https://docs.rs/bytes/1/bytes/trait.Buf.html)
* `markup`, which implements [`Render`](https://docs.rs/markup/0.13/markup/trait.Render.html) trait, so `CompactString`s can be used in templates as HTML escaped strings
* `arbitrary`, which implements the [`arbitrary::Arbitrary`](https://docs.rs/arbitrary/1/arbitrary/trait.Arbitrary.html) trait for fuzzing
* `proptest`, which implements the [`proptest::arbitrary::Arbitrary`](https://docs.rs/proptest/1/proptest/arbitrary/trait.Arbitrary.html) trait for fuzzing
* `quickcheck`, which implements the [`quickcheck::Arbitrary`](https://docs.rs/quickcheck/1/quickcheck/trait.Arbitrary.html) trait for fuzzing
* `rkyv`, which implements [`rkyv::Archive`](https://docs.rs/rkyv/0.7/rkyv/trait.Archive.html), [`rkyv::Serialize`](https://docs.rs/rkyv/0.7/rkyv/trait.Serialize.html) and [`rkyv::Deserialize`](https://docs.rs/rkyv/0.7/rkyv/trait.Deserialize.html) for fast zero-copy serialization, interchangable with serialized Strings
* `smallvec`, provides the `into_bytes()` method which enables you to convert a `CompactString` into a byte vector, using [`smallvec::SmallVec`](https://docs.rs/smallvec/latest/smallvec/struct.SmallVec.html)
### How it works
Note: this explanation assumes a 64-bit architecture, for 32-bit architectures generally divide any number by 2.
Normally strings are stored on the heap since they're dynamically sized. In Rust a `String` consists of three fields, each of which are the size of a `usize`.
e.g. its layout is something like the following:
`String: [ ptr<8> | len<8> | cap<8> ]`
1. `ptr` is a pointer to a location on the heap that stores the string
2. `len` is the length of the string
3. `cap` is the total capacity of the buffer being pointed to
This results in 24 bytes being stored on the stack, 8 bytes for each field. Then the actual string is stored on the heap, usually with additional memory allocated to prevent re-allocating if the string is mutated.
The idea of `CompactString` is instead of storing metadata on the stack, just store the string itself. This way for smaller strings we save a bit of memory, and we
don't have to heap allocate so it's more performant. A `CompactString` is limited to 24 bytes (aka `size_of::<String>()`) so it won't ever use more memory than a
`String` would.
The memory layout of a `CompactString` looks something like:
`CompactString: [ buffer<23> | len<1> ]`
#### Memory Layout
Internally a `CompactString` has two variants:
1. **Inline**, a string <= 24 bytes long
2. **Heap** allocated, a string > 24 bytes long
We define a discriminant (aka track which variant we are) *within* the last byte, specifically:
1. `0b11111110` - All 1s with a trailing 0, indicates **heap** allocated
2. `0b11XXXXXX` - Two leading 1s, indicates **inline**, with the trailing 6 bits used to store the length
and the overall memory layout of a `CompactString` is:
1. `heap: { ptr: NonNull<u8>, len: usize, cap: Capacity }`
2. `inline: { buffer: [u8; 24] }`
<sub>Both variants are 24 bytes long</sub>
For **heap** allocated strings we use a custom `HeapBuffer` which normally stores the capacity of the string on the stack, but also optionally allows us to store it on the heap. Since we use the last byte to track our discriminant, we only have 7 bytes to store the capacity, or 3 bytes on a 32-bit architecture. 7 bytes allows us to store a value up to `2^56`, aka 64 petabytes, while 3 bytes only allows us to store a value up to `2^24`, aka 16 megabytes.
For 64-bit architectures we always inline the capacity, because we can safely assume our strings will never be larger than 64 petabytes, but on 32-bit architectures, when creating or growing a `CompactString`, if the text is larger than 16MB then we move the capacity onto the heap.
We handle the capacity in this way for two reaons:
1. Users shouldn't have to pay for what they don't use. Meaning, in the _majority_ of cases the capacity of the buffer could easily fit into 7 or 3 bytes, so the user shouldn't have to pay the memory cost of storing the capacity on the heap, if they don't need to.
2. Allows us to convert `From<String>` in `O(1)` time, by taking the parts of a `String` (e.g. `ptr`, `len`, and `cap`) and using those to create a `CompactString`, without having to do any heap allocations. This is important when using `CompactString` in large codebases where you might have `CompactString` working alongside of `String`.
For **inline** strings we only have a 24 byte buffer on the stack. This might make you wonder how can we store a 24 byte long string, inline? Don't we also need to store the length somewhere?
To do this, we utilize the fact that the last byte of our string could only ever have a value in the range `[0, 192)`. We know this because all strings in Rust are valid [UTF-8](https://en.wikipedia.org/wiki/UTF-8), and the only valid byte pattern for the last byte of a UTF-8 character (and thus the possible last byte of a string) is `0b0XXXXXXX` aka `[0, 128)` or `0b10XXXXXX` aka `[128, 192)`. This leaves all values in `[192, 255]` as unused in our last byte. Therefore, we can use values in the range of `[192, 215]` to represent a length in the range of `[0, 23]`, and if our last byte has a value `< 192`, we know that's a UTF-8 character, and can interpret the length of our string as `24`.
Specifically, the last byte on the stack for a `CompactString` has the following uses:
* `[0, 192)` - Is the last byte of a UTF-8 char, the `CompactString` is stored on the stack and implicitly has a length of `24`
* `[192, 215]` - Denotes a length in the range of `[0, 23]`, this `CompactString` is stored on the stack.
* `[215, 254)` - Unused
* `254` - Denotes this `CompactString` is stored on the heap
* `255` - Denotes the `None` variant for an `Option<CompactString>`
### Testing
Strings and unicode can be quite messy, even further, we're working with things at the bit level. `compact_str` has an _extensive_ test suite comprised of unit testing, property testing, and fuzz testing, to ensure our invariants are upheld. We test across all major OSes (Windows, macOS, and Linux), architectures (64-bit and 32-bit), and endian-ness (big endian and little endian).
Fuzz testing is run with `libFuzzer`, `AFL++`, *and* `honggfuzz`, with `AFL++` running on both `x86_64` and `ARMv7` architectures. We test with [`miri`](https://github.com/rust-lang/miri) to catch cases of undefined behavior, and run all tests on every Rust compiler since `v1.57` to ensure support for our minimum supported Rust version (MSRV).
### `unsafe` code
`CompactString` uses a bit of unsafe code because we manually define what variant we are, so unlike an enum, the compiler can't guarantee what value is actually stored.
We also have some manually implemented heap data structures, i.e. `HeapBuffer`, and mess with bytes at a bit level, to make the most out of our resources.
That being said, uses of unsafe code in this library are constrained to only where *absolutely* necessary, and always documented with
`// SAFETY: <reason>`.
### Similar Crates
Storing strings on the stack is not a new idea, in fact there are a few other crates in the Rust ecosystem that do similar things, an incomplete list:
1. [`smol_str`](https://crates.io/crates/smol_str) - Can inline 22 bytes, `Clone` is `O(1)`, doesn't adjust for 32-bit archs
2. [`smartstring`](https://crates.io/crates/smartstring) - Can inline 23 bytes, `Clone` is `O(n)`, is mutable
3. [`kstring`](https://crates.io/crates/kstring) - Can inline 15 or 22 bytes dependent on crate features, `Clone` is `O(1)`, can also store `&'static str`s
4. [`flexstr`](https://crates.io/crates/flexstr) - Can inline 22 bytes, `Clone` is `O(1)`, can also store `&'static str`s
<br />
Thanks for readingme!
Á«¡© ª ® ¯ · À1í1Y1 Z1£®1¿ßŽ1še Ž*1 e 1¢e
1ÃL С1Ä 
æ¡ 1Ùõƒ¢1ç£r1é!®¢ý0ö!É¢ò0¤#ç¢ë0ïy£â0ÅÏ×á0 `žà0‰foß0»Ï¡Þ0ˆê£Ñ0òPÍÐ0µÏ0Þªô#Î0¾Ë¥#Í0·Ìì2ï2ò2å2è2dp
à2ã2Ô2×2œ¢
Ë2T»
¾2Á2Ÿ2¢2Äæ
2L„
‡2Š2q2t2^2a2Q2T2<2?2$2'2Lå
22þ12$•
ô1÷1ç1ê1„¸
ß1|Î
Ò1Äã
¹1dþ
D

4
ÜÓüIF Creates a `CompactString` using interpolation of runtime expressions.ÁJúüNEB The first argument `format_compact!` receives is a format string.Áü”" This must be a string literal.Áü·A> The power of the formatting string is in the `{}`s contained.ÁùúüýNK Additional parameters passed to `format_compact!` replace the `{}`s withinÁüÌ<9 the formatting string in the order given unless named orÁü‰JG positional parameters are used; see [`std::fmt`] for more information.ÁÔúüØIF A common use for `format_compact!` is concatenation and interpolationÁ of strings.Áü²FC The same convention is used with [`print!`] and [`write!`] macros,Áüù85 depending on the intended destination of the string.Á²úü¶2/ To convert a single value to a string, use theÁüé;8 `ToCompactString::to_compact_string` method, which usesÁü¥/, the [`std::fmt::Display`] formatting trait.ÁÕú # PanicsÁæúüêIF `format_compact!` panics if a formatting trait implementation returnsÁl´
an error.ÁÂúüÆ41 This indicates an incorrect implementation sinceÁüûGD `ToCompactString::to_compact_string` never returns an error itself.Á(|Ãì6 ï è  õ , ö ÷ ÿ, ø8argÁù& ü8¯ý
*ƒ   æ , 8, ' 8¥#|˜ '§ 8¼#Œ©  º  à   » , ¼ 8' 8í'È 8ë Õ  Ö  ß , ×  Ø  Ý , Ù 8±’Ú 
Þ D™
$
%4l~¡¢ÆÚÛÜÝÞߣLÅÏ í*ë"µ 3#oL»$«6D½Õ¯T•BÖÎr×Îs×Î7DÇÙØÊÙ¤»$­¯Ÿ¡„?•d£'(+-.½¾ÎÐL Û%&´¼BTH%üÆ/„Ï%)¤¸ÕZ2[((üî/¼ô%,î[üß”å%Ô²Ào013üŒ)Ào//
0ý¯dü• &¹  ¹ Ào/ ¬ /
1$­ [e11ì¼%<Ã%º  º Ào/ Ë%/
3$Ì%=>?ABTVYcÕ46íë47µ "48«6D@½49µ$[Þ4;µß4;øDe Ú4<$rtdfÌ/Y,NLN+-ÔÐ4¤’<˜4”¬@ü¿C„Æ
Acur_lenÁ<×
additionalÁT笙ºp½÷òf÷-CDES̵¹BB§ ïíe¼îËè¿*ØBBŒèìBBÀo|´ºpGHIJMNOô»  » ºpF  F
G®ãü¯
-
ºpFF
Hý
ü=¼  ¼ ºpF žF
I®ãÖœüùD€½  ½ ºpF F
Jü³6¼¶4¾  ¾ ºp Ô
KthisÁ$ÎWgKKüœC¿  ¿ ºpÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
F «F
M new_capacityÁd¶ü¡E,<¯EÀ  À ºpF ·EF
N$¼EÂEÌÅF<ÌFÁ  Á ºpF ÔFF
O$ÙFÌ–GºpQÙQ¼¶G,¹GÂ  Â ºpºpP ¿GP
Q$ÀGÄ´LºpS"S”ÓL$ÖLÃ  Ã ºpR ÛLR
S$àLü›ODd¢OÀo©ž
TýD¯Oü¿RFôÂR4©ž
UýDáRüÿY;t†Z©žÀo
Vµ •ZάZüÍZ:üÐZ 4©ž
Wµ ñZ³gWWŒÞclâc4]^_bµ €dYZ¤,d“FY[L©d?Y\Lúc9Td,„¢düÇd1,Îd©ž
]ýDÔdüèk=<ök©ž
^µ þkýD•lü—m"ÜžmY__Ž`ýYa·Yã/‡k?(‡[ã/‡k?(‡[`a|ÄmDÄmY__ŒÝm4ÝmY__ûœü‘n/4˜nèØèØ éØ²‚êØŸ²‚ªë¥CHÈ
býDŸnœÕp|Ùp4ghikµ ùpcd¤,q“FceL¢q?cfLóp9T†q,„›qüóq8,r©ž
gýD‡rüœy=<ªy©ž
hµ ²yýDÉyüËz$ìÒzciij·cïú/³7A ïú/³7A jŒúz4úzciiûœü®{/4µ{¬
kýD¼{4¿rs×µ 
lmµ$!Þloµßlo\+ ÜlpøD< ÚlqL],PR/1 "/IÚà¬}Cq#ÂzstuÚàjI9•±Úàrr
s”Êrr•±hŒ˜Úàwy{|}ü‹%Ä  Ä Úàv £v
w®ã$ÿhwwüÈ * Å  Å Úàv å vÎæ®ã<i gyyäÞÚàvv
{ü»,Æ  Æ Úàv Ñv
|ÜÔéÇ  Ç ÚàÚàv õv
}dmÃL~oŒ»~Îr~×Îs~×µÞ~ƒµß~ƒøD¿ Ú~½flש ~½fª ~Äa¸„¬,–ž tvPR¤ÐCüç ƒq‡ÅLüŽ;L‘ô¡ƒq¥ˆˆÍìô¡ ÇLô¡Ìžô¡ÈL
ô¡ù68ü’(銊ƒq‹ÅLüÁ?¥ƒq¥ŒŒÍ쫹 ÎÇL«¹ìÑ«¹ÈL÷q|Þ
髹ù=?ü¸ªÄ»~šƒq¤ŽšŽÍì¤ ÔÍì̺ ×à…»ùM̺̺úM…»ÐL–s…»¬¯ÃL–s…»
…»̺ùƒüÊ'éƒq’ÅLÏüø>«¹ƒq¥Ó¹ ä¹äˆ «¹ÈLŠrt• 
髹ù57üõ $ƒq•ÅLü !?L£!ô¡ƒq¥‹¸ ­!œ¸ì°!ô¡ÈLr|½!
ô¡ù$Ï!/1üž""ƒq˜ÅL˜üÇ"=LÊ"ô¡ƒq¥‹¸ Ô"œ¸Ü×"ô¡ÈLslä"
˜ô¡ù$ô"/1üÃ#)ƒq›ÅLüó#DLö#ô¡ƒqš¥œœš‹¸ €$œ¸üƒ$"ô¡ÈLÎs¤$
ô¡ù$§$02üö$,éžžƒqŸÅLŸû$ü©%CL¬%«¹ƒq¥  Ó¹ ¶%ä¹ü¹%!«¹ÈL‰tœÆ%
Ÿé«¹ù$Ü%68ÙÝ
á©°í뢤²˜í¢¥µ ¡¢¦Ê¢§µÞ¢¨µß¢¨np]_¼®P\ËAÜÙ¢ ‡£Ô® É ö Ï è , Ð8¿ Ñ& Ò8¼$ Ø, Ú8conv_tyÁ& â8¼*ê í ó888
, 8¿ Š Œ í+ š  ¢8Ý8 °8 ¼ Á8(Ã8µ Ë ãD8ç8
num_digitsÁ ö8Æ'8ÖL  8% 8£8§8  °8µ'8ãl¸ Å Ð8Æ% Ñ+ ä å ÿ8« ë þ8unused_comparisonsÁ”ì8 8is_nonnegativeÁt•  ¤ 8« 7ˆ ® % ¯ 8Á 8Å 8¹ É  Ë 8Í 8ªÈ ß 
88ú , ý 8³Ä8$˜

 Ç   ¥    ¤ 8$” 8 , œ 8³Ä<  ¦ 8æ  ³  µ 7 ´ % È 8Ú 8Þ 8currÁ  ç 8Æ 8ô 8ó % ü 8"  Ö  ñ 8  Ü 8½  ä  ï 8Æ % ò 8¹
8buf_ptrÁ
 Å
8"
 Î
 ï
8
 Ô
8È
 ß
 à
 á
8ÿ(
 ì
 í
% ð
8ƒ8lut_ptrÁ<‡ 8Ût Ÿ8ñ( ¦ §% ¨8"  Ï%8­8í°'³8š'¼ ¾, ¿8¿ À Á  ÃÅ7Š È Ê ©8%8¹ «­710000Á  '8Ô8ƒ Ø Ü Þ è8¹ ß á7¢Ï8ê8ó% ò8¹ 7¢Ï,•% š8¹8d1Á½ À  Ì8ƒ à Ç7100ÁÉÎ7 Ñ% Ò8ð8d2Áô ÷ ù ƒ8ƒ ú þ7‡Ñ7 ˆ% 8ƒË¬7Œ ¯% °8µ Î'Ñ8èœÓ æ  8©Í î8ž
 õ ø8ÓÐö$ ù8ŸÌ 8ž
  Ž8ƒË$ 7Š % 8µ ±'´8蜶 É ø 8©Í ò8ž
 ù ü8¹Ñú$ ý8ŸÌ ¦8ž
 ­ 8ƒË ³7Š µ$ ·7Š Ù$ Ú% ù888¹  Ÿ8¹ ¡8£8ó% «88¹ œž7‡Ñ¡ ¥ 8¿8ÓÐÃ Æ È Ð8¹ É Ë7‡ÑÍÒ7 Õ% Ö8¹ ðò7‡Ñõ% ø8ƒË$’7Š š% 8µ µ'¸8蜺 Í ù 8©Í Õ8ž
 Ü ß8ÓÐÝ$ à8ŸÌ é8ž
 ð õ8ƒË$ ö7Š ø% ú8×8¹ Ú Ü710ÁÞ á Ü8ƒË7 ƒ% 
ž8ŸÌ ¦8ž
 ­ ²8ƒË ´  ¾8¹ ·8¹8ȼ À7ˆ% Æ8 ã ¤8ý8ÓÐ 8¹ ˆ7 % Œ8ƒË«7Š ®% ¯8µ É'Ì8èœÎ á  8©Í é8ž
 ð ó8ÓÐñ$ ô8ŸÌ ý8ž
  8ƒË$…$ Š7Š Œ% Ž8» ¾8ªÈt¿ Î ½ 8ƒËí7 ð% ñ
8ŸÌ 8ž
4” š Ÿ8ƒË$› ¡7% §8debug_assert_eqÁ µ  ¾8ƒË$ »7ˆ ½% ¿8 % ô´¨$¬Ë¬ÔÓ$LÖ$ƒq««
¬$à$´Î%®Ë®Ôù%Lü%ƒq­­
®$†&ü½'"¬Ê' à' ™) æ' î', ç'8¿ è'& é'8õ
$ê'*ð' ó' )8$ý'8D(8
(, (8¿ ( ( )+  ( ¡( ¨(8Ý4¢(8 ¶(8L¹( Â( Ç(8$Ã((É(8µ$Ì( Ñ( †)8$ã( ç(8getÁè( ë( ì( í(8Lî( ÷( ø(% —)t“7D™7¢°°Îìü“78°‹å‹å±±±ü¨7!L«7¢“å°°
±“å¹µ7¤Í7³±³ôþ7L8¢²²
³¹‹8¤ž9µ±µôÏ9LÒ9¢´´
µ¹Ü9¬À;·±·üò;Lõ;¢
·¹ÿ;¬Ñ=¹±¹üƒ>L†>¢¸¸
¹¹>¬ó@»±»ü¥AL¨A¢ºº
»¹²A¬¾D½±½üðDLóD¢¼¼
½¹ýD¬ßJ¿±¿ü‘KL”K¢¾¾
¿¹žK¬¼RÁ±ÁüîRLñR¢ÀÀ
Á¹ûR¼—`ñÃüµ`!L¸`¢ÂÂ
ùÂ`¼±bűÅüÏb!LÒb¢ÄÄ
ŹÜbÈÉʵ$ ÞÆÇµßÆÇ\,ƃq„A$Gƃq”®ÊÊ‹åü®6Ê‹å‹åËËËÜÇ“åƒqÊÊ
Ë“å¬æÍËÍÔ‚L…ƒqÌÌ
Í$¬‰ÏËÏÔ¥ƒqÎÎ
Ï´¬ÑËÑÔɃqÐÐ
Ñ´¿ÓËÓÔ܃qÒÒ
Ó ÓÓ”÷%.„.¤¥ .„¿í-„Ùà-Ì›¼̰ŒÙƒq$jƒqÞz‡e`¾æßàáâãäåÇŸítƒqrjLÇŸítƒqÞÞ
ßÞÞÇŸÞÞÉû64ÁÜ«ü¥#ÞÞÒÞÞÛÞÞÞÞítÌÑ ƒqÌî ƒq
ƒqéêëìîðóõö÷øùúûüþÿƒˆôª
±
È  È ƒqè »
è
é®ã
üù
+T†É  É ƒqè 豉®ãðrüš-ƒqèè
ëýüÎCÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
ƒqÅÏÅÏ£ÆÏ valid_up_toÁ¯vÇÏ error_lenÁ¯vlÅooÛÜ èèííèÍìèø ßàèø‡£
ìèøbufÁï,.ü²AœÀèøƒqèïïè±ú ÔÂú
îèøàùä üä$:\ë$–sƒqèè
ð¾ ÷$
should_inlineÁl%ü†&&„‰&sƒq
ñ¾ š&”¨',«'ƒq
òüˆ0"\0ƒq–sèè
ó$›0üð0/„ó0ºps
ô¨¡$„1ü¥B,<¬BÊ  Ê ƒqè ´Bè
õ$¹BÖœT¿BüƒP0LŠPË  Ë ƒqè ”Pè
ö$™P min_capacityÁdŸPü¡\#D¨\Ì Í  Ì ƒq Í è ±\è
÷$¶\¾ ¼\üÖb%ÝbÎ  Î ƒqÛ¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙè ábè
ø$æbüÇeDÎeÏ  Ï ƒq Ï ‡£è ×eè
ù$Øeä…o4ŒoÐ  Ð ƒq Ð è “oè
ú$”oÔ¼qÃqÑ  Ñ ƒqè Çqè
û$Èqü¥xD¬xÒ  Ò ƒqè µxè
ü$¶xüÌy&lÏyÓ  Ó ƒq ãy
ý¨¡$ÝyüË|'ŒÒ|Ô  Ô ƒqè ä|è
þ$å|ü‚0TÕ  Õ ƒq Õ ‡£è è
ÿü²†,<À†Ö  Ö ƒqè Ȇè
$͆Ó†üþL‡Ž×  × ƒqè ‘Žè
$’Žü¨”2\±”Úàƒqèè¨Ý^yüî˜,L÷˜ºpƒqèè
ƒ·yüõ-L…žƒqºpèè
Ûxü¸¢3\¢Ø  Ø ƒq Ø ºpè ΢è
$Ó¢üȧ'<Ò§Ù  Ù ƒq Ù ºpè Ú§è
$Û§ü±7ḻÚ  Ú ƒq Ú Úàè Ú±è
$ß±üá¶+Lë¶Û  Û ƒq Û Úàè õ¶è
ˆ$ö¶œ¸ƒqŠÙм·¸,º¸Ü  Ü ƒqƒq À¸
Š$Á¸ü”¹"T—¹Ý  Ý ƒqƒq ¨¹
¨¡$¢¹”¢Àƒq"”ÉÀ$ÌÀÞ  Þ ƒqŒ ÑÀŒ
$ÖÀüïÂ!lòÂß  ß ƒq †Ã
ލ¡$€ÃÔàăqÒLüÅ;4’Åà  à ƒqô¡¥ ·Å‹¸ ™Åœ¸ÌœÅ¬¸\©Å
ô¡$¼Åù$ÂÅ13ýÇ<closure_kind>Á<closure_signature>Á<upvars>Áô¡ ƒq ¦Èü¶È"éƒq–ÒL»ÈüßÈ?4âÈá  á ƒq«¹¥ ‹ÉÓ¹ éÈä¹ììÈô¹|ùÈ
髹$Éù$–É79üÚÉ!éƒqšÒLšßÉü‚Ê>4…Êâ  â ƒq«¹˜¥ ­Ê˜Ó¹ ŒÊä¹äʱ½tœÊ
šé«¹$²Êù$¸Ê79åʚΜ眅‘œœšœ«¹»Æ¼’ô…˃qžÒLžüªË?4­Ë
½|T´
4¸
·¾×$  `«­WriteÁ, êb«®²3 í«¯
match_typeÁTM ¨«± LifetimeFreeÁd] Z«²D† Ê«´Ùµ$” Þ«µ½fl¨ © «½fª «L ×
ÃÅL- ¶D= Ÿ\s tv_a¤¡ RÌ” ü¸8 5 A trait for converting a value to a `CompactString`.Áñ úüõM J This trait is automatically implemented for any type which implements theÁüÃ[ X [`fmt::Display`] trait. As such, [`ToCompactString`] shouldn't be implemented directly:ÁüŸW T [`fmt::Display`] should be implemented instead, and you get the [`ToCompactString`]Áä÷  implementation for free.Á ··‹åü”´ ·‹å‹å ¸¸¸ü™- ü´4 1 Converts the given value to a [`CompactString`].Áí ú # ExamplesÁˆ ú
Basic usage:Á¥ ú<­  ```Áü¹% " use compact_str::ToCompactString;Áüã% " # use compact_str::CompactString;Á út• let i = 5;Áü¨' $ let five = CompactString::new("5");ÁÔ úüÜ, ) assert_eq!(i.to_compact_string(), five);Á< ñ¤Œœ æ  æ “åÎs· ® ·
¸“å üý*  # SafetyÁ× úüÛ5 2 * [`CompactString`] does not contain any lifetimeÁü‘"  * [`CompactString`] is 'staticÁü´H E * [`CompactString`] is a container to `u8`, which is `LifetimeFree`.ÁÎsü« ! ƒqü†+ ÖÞ úüâ a ^ In this implementation, the `to_compact_string` method panics if the `Display` implementationÁüÄ
P M returns an error. This indicates an incorrect `Display` implementation sinceÁü• F C `std::fmt::Write for CompactString` never returns an error itself.ÁÜ ú  # NoteÁë úüï c ` We use the [`castaway`] crate to provide zero-cost specialization for several types, those are:ÁüÓ 0 - * `u8`, `u16`, `u32`, `u64`, `u128`, `usize`Áü„
0 - * `i8`, `i16`, `i32`, `i64`, `i128`, `isize`Áôµ
 * `NonZeroU*`, `NonZeroI*`Á
* `bool`Á
* `char`Áüî
  * `String`, `CompactString`Á”Ž  * `f32`, `f64`Áü¡d a * For floats we use [`ryu`] crate which sometimes provides different formatting than [`std`]Á¥¼¼‹¸  Äcô¡ ô¡½¸½#%üÆ, ŒÉ ç  ç ô¡Îs» Û »
½ô¡ ÔÁ# üòa ^ A trait that provides convience methods for creating a [`CompactString`] from a collection ofÁüÔd a items. It is implemented for all types that can be converted into an iterator, and that iteratorÁü¹4 1 yields types that can be converted into a `str`.Áî úüò. + i.e. `C: IntoIterator<Item = AsRef<str>>`.Á¡ úÔ¥  # Concatenate and JoinÁüÀZ W Two methods that this trait provides are `concat_compact(...)` and `join_compact(...)`Á< ñ¤ü£ & # use compact_str::CompactStringExt;ÁÊ úüÎ 9 6 let words = vec!["☀ï¸", "🌕", "🌑", "☀ï¸"];Áˆ! úüŒ!2 / // directly concatenate all the words togetherÁü¿!( % let concat = words.concat_compact();Áüè!/ , assert_eq!(concat, "☀ï¸ðŸŒ•🌑☀ï¸");Á˜" úüœ"' $ // join the words, with a seperatorÁüÄ". + let join = words.join_compact(" âž¡ï¸ ");Áüó"E B assert_eq!(join, "â˜€ï¸ âž¡ï¸ ðŸŒ• âž¡ï¸ ðŸŒ‘ âž¡ï¸ â˜€ï¸");Á<¹# ñ¤„Ë# ¾¾‹åüÁ#ã ¾‹å‹å ¿À¿ÀÀ¿ü¨&* üâ#G D Concatenates all the items of a collection into a [`CompactString`]Á®$ úl¶$
# ExampleÁ<È$ ñ¤üÔ$& Àµÿ$ úü‡%- * let items = ["hello", " ", "world", "!"];Áü¹%) & let compact = items.concat_compact();Áç% úüï%( % assert_eq!(compact, "hello world!");Á<œ& ñ¤t«& è  è “åÎs¾ º& ¾
¿“å$»& üÝ)E üØ&T Q Joins all the items of a collection, placing a seperator between them, forming aÁ¬±'  [`CompactString`]ÁË' úlÓ' úº<å' ñ¤üñ'& Àµœ( úü¤(6 3 let fruits = vec!["apples", "oranges", "bananas"];Áüß(, ) let compact = fruits.join_compact(", ");Á) úü˜)4 1 assert_eq!(compact, "apples, oranges, bananas");Á<Ñ) ñ¤dà) é  é “å¤Îs¾¤ÁÁ ü) ¾ÍìòÁ í) àòÁTð)
À“åòÁ$ý)  seperatorÁLƒ* ;=ü¦*i šÃÄÃÄŠŢÈL Åšd+ Íì¢ ®* àÃÃTÕ* ÅÇL©ÃÔô* ÍìÃà «* ¢ÆÈ¿ÀÆÈ ceé* ü–+) t™+ ê  ê ¢Îs ¨+ Â
ÆÃâ$©+ lŒ, ÆÎÇçÇ…‘ÇÇÆÇÃâÎs ÃÃÎsüó,D dö, ë  ë ¢¤Îs¤ÉÉ ’- ÂÍìÕÆ ƒ- àÕÆT†-
ÈÃ̢ͮ$“- ÖÁL™- 79
&)‘”Ì
ÎsÎÐÑÒÔÖØÚÛÜÝÞßàáâäåæçèéìîïðñòóôõ÷øùûüýÿšü†-*
üåO
L Creates a new [`CompactString`] from any type that implements `AsRef<str>`.Áü¹ H
E If the string is short enough, then it will be inlined on the stack!Á†!
útŽ!
©¤¡!
ú|©!
### InlinedÁ<½!
ñ¤üÉ!%
񝁢!P
M // We can inline strings up to 12 characters long on 32-bit architectures...ÁüÈ"'
$ #[cfg(target_pointer_width = "32")]ÁÜô"
 let s = "i'm 12 chars";Áü”#:
7 // ...and up to 24 characters on 64-bit architectures!ÁüÓ#'
$ #[cfg(target_pointer_width = "64")]Áüÿ#'
$ let s = "i am 24 characters long!";Á«$
úü³$)
& let compact = CompactString::new(&s);Áá$
úÜé$
 assert_eq!(compact, s);Áü‰%(
% // we are not allocated on the heap!Áü¶%*
' assert!(!compact.is_heap_allocated());Á<å%
ñ¤ñ%
údù%
### HeapÁ<Š&
ñ¤ü–&%
±¥üÀ&>
; // For longer strings though, we get allocated on the heapÁüƒ'I
F let long = "I am a longer string that will be allocated on the heap";矄'+
( let compact = CompactString::new(long);Á(
úô‰(
 assert_eq!(compact, long);Áü¬($
! // we are allocated on the heap!ÁüÕ()
& assert!(compact.is_heap_allocated());Á<ƒ)
ñ¤)
ú„—)
### CreationÁ<¬)
ñ¤ü¸)#
use compact_str::CompactString;Áà)
úìè)
 // Using a `&'static str`ÁÜŠ*
 let s = "hello world!";矻*'
$ let hello = CompactString::new(&s);ÁÖ*
ú¼Þ*
 // Using a `String`Áüú*%
" let u = String::from("🦄🌈");Áü¤+(
% let unicorn = CompactString::new(u);ÁÑ+
úÌÙ+
 // Using a `Box<str>`Áü÷+D
A let b: Box<str> = String::from("📦📦📦").into_boxed_str();ÁüÀ,'
$ let boxed = CompactString::new(&b);Á<ì,
ñ¤-
ô¡ÎsÍ¥ÏÏÍ‹¸ ‘-
àô¡T”-
Îô¡®ã$ -
(*üš2+
üî-;
8 Creates a new inline [`CompactString`] at compile time.Á®.
út¶.
©¤<É.
ñ¤üÕ.#
¥Òý.
úü…/N
K const DEFAULT_NAME: CompactString = CompactString::new_inline("untitled");Á<Ø/
ñ¤ä/
úüì/S
P Note: Trying to create a long string that can't be inlined, will fail to build.ÁœÄ0
 ```compile_fail矆0%
±¥ü†1u
r const LONG: CompactString = CompactString::new_inline("this is a long string that can't be stored on the stack");Á<€2
ñ¤T§2
ì  ì ÎsÍ ¸2
Í
ЮãOŒüÞB-
ü3]
Z Creates a new empty [`CompactString`] with the capacity to fit at least `capacity` bytes.Áã3
úüë3^
[ A `CompactString` will inline strings on the stack, if they're small enough. Specifically,ÁüÎ4X
U if the string has a length less than or equal to `std::mem::size_of::<String>` bytesÁü«5Z
W then it will be inlined. This also means that `CompactString`s have a minimum capacityÁüŠ6%
" of `std::mem::size_of::<String>`.Á´6
út¼6
©¤Ï6
ú¼×6
 ### "zero" CapacityÁ<ó6
ñ¤üÿ6%
±¥ü©7@
= // Creating a CompactString with a capacity of 0 will createÁüî7:
7 // one with capacity of std::mem::size_of::<String>();Áü­80
- let empty = CompactString::with_capacity(0);Áüâ81
. let min_size = std::mem::size_of::<String>();Á˜9
úü 9+
( assert_eq!(empty.capacity(), min_size);ÁäÐ9
 assert_ne!(0, min_size);Áüñ9(
% assert!(!empty.is_heap_allocated());Á<ž:
ñ¤ª:
ú¼²:
 ### Max Inline SizeÁ<Î:
ñ¤üÚ:%
±¥ü„;P
M // Creating a CompactString with a capacity of std::mem::size_of::<String>()ÁôÙ;
 // will not heap allocate.Áüü;1
. let str_size = std::mem::size_of::<String>();Áü²<7
4 let empty = CompactString::with_capacity(str_size);Áî<
úüö<+
( assert_eq!(empty.capacity(), str_size);Áü¦=(
•ã<Ó=
ñ¤ß=
ú¼ç=
 ### Heap AllocatingÁ<ƒ>
ñ¤ü>%
±¥ü¹>C
@ // If you create a `CompactString` with a capacity greater thanÁü?F
C // `std::mem::size_of::<String>`, it will heap allocated. For heapÁüÌ?3
0 // allocated strings we have a minimum capacityÁ„@
úüŒ@F
C const MIN_HEAP_CAPACITY: usize = std::mem::size_of::<usize>() * 4;Á×@
úüß@6
3 let heap_size = std::mem::size_of::<String>() + 1;ÁüšA8
5 let empty = CompactString::with_capacity(heap_size);Á×A
úüßA4
1 assert_eq!(empty.capacity(), MIN_HEAP_CAPACITY);Áü˜B'
$ assert!(empty.is_heap_allocated());Á<ÄB
ñ¤låB
ÎsÍÍ
ÑýDóB
üªLC
üÎC6
3 Convert a slice of bytes into a [`CompactString`].Á‰D
úü‘D
~ A [`CompactString`] is a contiguous collection of bytes (`u8`s) that is valid [`UTF-8`](https://en.wikipedia.org/wiki/UTF-8).Áü—EP
M This method converts from an arbitrary contiguous collection of bytes into aÁüìEE
B [`CompactString`], failing if the provided bytes are not `UTF-8`.Á¶F
úü¾F^
[ Note: If you want to create a [`CompactString`] from a non-contiguous collection of bytes,Áü¡GT
Q enable the `bytes` feature of this crate, and see `CompactString::from_utf8_buf`ÁúG
útH
©¤œ•H
 ### Valid UTF-8Á<­H
ñ¤ü¹H%
±¥üãH=
: let bytes = vec![240, 159, 166, 128, 240, 159, 146, 175];矴IH
E let compact = CompactString::from_utf8(bytes).expect("valid UTF-8");ÁòI
úüúI$
! assert_eq!(compact, "🦀💯");Á<£J
ñ¤¯J
ú¬·J
 ### Invalid UTF-8Á<ÑJ
ñ¤üÝJ%
±¥ü‡K$
! let bytes = vec![255, 255, 255];Áü°K1
. let result = CompactString::from_utf8(bytes);ÁæK
úìîK
 assert!(result.is_err());Á<L
ñ¤L±L
èøÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
Îs¾ùÍÓÓͱú »L
Âú\¾L
ÒèøàùËL
 üUA
ü«M_
\ Converts a vector of bytes to a [`CompactString`] without checking that the string containsÁN
valid UTF-8.Á¤N
úü¬NI
F See the safe version, [`CompactString::from_utf8`], for more details.ÁúN
údO
Û§“O
úü›O[
X This function is unsafe because it does not check that the bytes passed to it are validÁüûO`
] UTF-8. If this constraint is violated, it may cause memory unsafety issues with future usersÁüàPN
K of the [`CompactString`], as the rest of the standard library assumes thatÁü³Q'
$ [`CompactString`]s are valid UTF-8.ÁßQ
útçQ
©¤úQ
ú„‚R
̤—R
ú<ŸR
ñ¤ü«R%
±¥ôÕR
 // some bytes, in a vectorÁüøR1
. let sparkle_heart = vec![240, 159, 146, 150];Á®S
úü¶S
 let sparkle_heart = unsafe {ÁüÛS9
6 CompactString::from_utf8_unchecked(sparkle_heart)Á4™T
 };Á¤T
úü¬T&
# assert_eq!("💖", sparkle_heart);Á<×T
ñ¤.\ñT
œU
èøÎsÍÕÕͱú £U
Âú\¦U
Ôèøàù³U
 ü“\F
ü†VS
P Decode a [`UTF-16`](https://en.wikipedia.org/wiki/UTF-16) slice of bytes into aÁüÞVS
P [`CompactString`], returning an [`Err`] if the slice contains any invalid data.Á¶W
út¾W
©¤¤ÑW
 ### Valid UTF-16Á<êW
ñ¤üöW%
±¥ü XP
M let buf: &[u16] = &[0xD834, 0xDD1E, 0x006d, 0x0075, 0x0073, 0x0069, 0x0063];ÁüõX:
7 let compact = CompactString::from_utf16(buf).unwrap();Á´Y
úü¼Y%
" assert_eq!(compact, "ð„žmusic");Á<æY
ñ¤òY
ú´úY
 ### Invalid UTF-16Á<•Z
ñ¤ü¡Z%
±¥üËZP
M let buf: &[u16] = &[0xD834, 0xDD1E, 0x006d, 0x0075, 0xD800, 0x0069, 0x0063];Áü [-
* let res = CompactString::from_utf16(buf);ÁÒ[
úÔÚ[
 assert!(res.is_err());Á<ù[
ñ¤Tš\
èøÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
Îs„¨Í××ͱú ¥\
àèø
d¨\
Öèøàù¶\
*,üðe8
ü¢a[
X Decode a UTF-16–encoded slice `v` into a `CompactString`, replacing invalid data withÁü‚b.
+ the replacement character (`U+FFFD`), �.Áµb
út½b
©¤Ðb
ú„Øb
̤íb
ú<õb
ñ¤üc%
񝁮c"
 // ð„žmus<invalid>ic<invalid>ÁüÒc-
* let v = &[0xD834, 0xDD1E, 0x006d, 0x0075,Áü„d-
* 0x0073, 0xDD1E, 0x0069, 0x0063,Á´¶d
 0xD834];ÁÑd
úüÙd@
= assert_eq!(CompactString::from("ð„žmus\u{FFFD}ic\u{FFFD}"),Áüže3
0 CompactString::from_utf16_lossy(v));Á<Öe
ñ¤„÷e
èøÎsÍÙÙͱú ˆf
÷‡df
Øèøàù™f
 ÔÔm
üähW
T Returns the length of the [`CompactString`] in `bytes`, not [`char`]s or graphemes.ÁÀi
úüÈi`
] When using `UTF-8` encoding (which all strings in Rust do) a single character will be 1 to 4Áü­j]
Z bytes long, therefore the return value of this method might not be what a human considersÁìk
 the length of the string.Á±k
út¹k
©¤<Ìk
ñ¤üØk%
±¥ü‚l2
/ let ascii = CompactString::new("hello world");Áü¹l
 assert_eq!(ascii.len(), 11);ÁÞl
úüæl+
( let emoji = CompactString::new("👱");Áü–m
 assert_eq!(emoji.len(), 4);Á<ºm
ñ¤Ûm
í  í ÎsÍ ßm
Í
Ú$àm
ôq
ü‘nP
M Returns `true` if the [`CompactString`] has a length of 0, `false` otherwiseÁæn
útîn
©¤<o
ñ¤üo%
±¥ü·o)
& let mut msg = CompactString::new("");Áäåo
 assert!(msg.is_empty());Á†p
úÔŽp
 // add some charactersÁü­p"
 msg.push_str("hello reader!");ÁìÔp
 assert!(!msg.is_empty());Á<öp
ñ¤D—q
î  î ÎsÍ  q
Í
Û$¡q
üüv
üÔq<
9 Returns the capacity of the [`CompactString`], in bytes.Á•r
úTr
—¬ü¬r_
\ * A `CompactString` will always have a capacity of at least `std::mem::size_of::<String>()`Ás
út˜s
©¤¤«s
 ### Minimum SizeÁ<Äs
ñ¤üÐs%
񝁣s1
ôáü°t)
& let compact = CompactString::new("");ÁÞt
úüæt,
) assert!(compact.capacity() >= min_size);Á<—u
ñ¤£u
ú´«u
 ### Heap AllocatedÁ<Æu
ñ¤üÒu%
񝁁u4
1 let compact = CompactString::with_capacity(128);Áüµv(
% assert_eq!(compact.capacity(), 128);Á<âv
ñ¤Dƒw
ï  ï ÎsÍ Œw
Í
Ü$w
üî~,
üÃw]
Z Ensures that this [`CompactString`]'s capacity is at least `additional` bytes longer than矴x\
Y its length. The capacity may be increased by more than `additional` bytes if it chooses,矠y&
# to prevent frequent reallocations.Á±y
úT¹y
—¬üÈy_
\ * A `CompactString` will always have at least a capacity of `std::mem::size_of::<String>()`Áü¬zW
T * Reserving additional bytes may cause the `CompactString` to become heap allocatedÁˆ{
úd{
Öü¡{0
- Panics if the new capacity overflows `usize`ÁÖ{
útÞ{
©¤<ñ{
ñ¤üý{%
±¥§|
úü¯|5
2 const WORD: usize = std::mem::size_of::<usize>();Áüé|/
, let mut compact = CompactString::default();Áü}2
/ assert!(compact.capacity() >= (WORD * 3) - 1);ÁÔ}
úÌÜ}
 compact.reserve(200);Áüú})
³Ñü¨~'
$ assert!(compact.capacity() >= 200);Á<Ô~
ñ¤<õ~
ð  ð ÎsÍ ý~
Í
Ý$
ÖœTˆ
äÜ
üËC
@ Returns a string slice containing the entire [`CompactString`].Á“€
út›€
©¤<®€
ñ¤üº€%
±¥üä€(
% let s = CompactString::new("hello");Á
úü™$
! assert_eq!(s.as_str(), "hello");Á
ñ¤
ñ  ñ Îs ñ Í ê
Í
Þ
üê„(
üž‚K
H Returns a mutable string slice containing the entire [`CompactString`].Áî‚
útö‚
©¤<‰ƒ
ñ¤ü•ƒ%
±¥ü¿ƒ,
) let mut s = CompactString::new("hello");Áüðƒ*
' s.as_mut_str().make_ascii_uppercase();ÁŸ„
úü§„$
! assert_eq!(s.as_str(), "HELLO");Á<Є
ñ¤Tñ„
ò  ò Îs ò Í ü„
Í
ß$
ü´ˆ
ü”†=
: Returns a byte slice of the [`CompactString`]'s contents.ÁÖ†
útÞ†
©¤<ñ†
ñ¤üý†%
±¥ü§‡(
̤ԇ
úü܇9
6 assert_eq!(&[104, 101, 108, 108, 111], s.as_bytes());Á<šˆ
ñ¤D»ˆ
ó  ó Îs ó ‡£Í Ĉ
Í
à$ň
üµ2
üë‰C
@ Provides a mutable reference to the underlying buffer of bytes.Á³Š
úd»Š
Û§üÌŠW
T * All Rust strings, including `CompactString`, must be valid UTF-8. The caller mustÁ|¨‹
guaranteeÁü¼‹I
F that any modifications made to the underlying buffer are valid UTF-8.ÁŠŒ
út’Œ
©¤<¥Œ
ñ¤ü±Œ%
±¥üÛŒ,
·§Œ
úü”,
) let slice = unsafe { s.as_mut_bytes() };矁!
 // copy bytes into our stringÁüë6
3 slice[5..11].copy_from_slice(" world".as_bytes());Áü¦Ž
 // set the len of the stringÁìËŽ
 unsafe { s.set_len(11) };ÁíŽ
úüõŽ!
 assert_eq!(s, "hello world");Á<
ñ¤
ô  ô Îs ô ‡£Í Ð
Í
á
üÖ’
ü‘D
A Appends the given [`char`] to the end of this [`CompactString`].ÁÚ
ú
©¤
ñ¤ü%
±¥ü«‘*
' let mut s = CompactString::new("foo");ÁÚ‘
ú„â‘
s.push('b');Á„÷‘
s.push('a');Á„Œ’
s.push('r');Á¡’
úä©’
 assert_eq!("foobar", s);Á<Ê’
ñ¤$Ý’
õ  õ ÎsÍ â’
Í
â$ç’
chÁí’
§“
ââü†—%
ü¸“I
F Removes the last character from the [`CompactString`] and returns it.Áü†”6
3 Returns `None` if this [`CompactString`] is empty.ÁÁ”
útÉ”
©¤<Ü”
ñ¤üè”%
±¥ü’•*
' let mut s = CompactString::new("abc");ÁÁ•
úüÉ•#
assert_eq!(s.pop(), Some('c'));Áüñ•#
assert_eq!(s.pop(), Some('b'));Áü™–#
assert_eq!(s.pop(), Some('a'));ÁÁ–
úôÉ–
 assert_eq!(s.pop(), None);Á<ì–
ñ¤
ö  ö ÎsÍ ‘—
Í
ä$–—
ü€š#
üΗG
D Appends a given string slice onto the end of this [`CompactString`]Áš˜
út¢˜
©¤<µ˜
ñ¤üÁ˜%
±¥üë˜*
æ·š™
ú´¢™
 s.push_str("123");Á½™
úäÅ™
 assert_eq!("abc123", s);Á<æ™
ñ¤D‡š
÷ ø  ÷ Îs ø Í š
Í
å$•š
¾ ›š
ü¿£,
üÌšU
R Removes a [`char`] from this [`CompactString`] at a byte position and returns it.Á¦›
úü®›N
K This is an *O*(*n*) operation, as it requires copying every element in theÁ\œ
 buffer.Á‘œ
úd™œ
Öªœ
úü²œN
K Panics if `idx` is larger than or equal to the [`CompactString`]'s length,Áü…1
. or if it does not lie on a [`char`] boundary.Á»
ú
©¤Ö
ú¤Þ
 ### Basic usage:Á÷
ú<ÿ
ñ¤ü‹ž%
±¥üµž3
0 let mut c = CompactString::from("hello world");Áíž
úüõž!
 assert_eq!(c.remove(0), 'h');Áü›Ÿ
 assert_eq!(c, "ello world");ÁÀŸ
úüÈŸ!
 assert_eq!(c.remove(5), 'w');ÁüîŸ
 assert_eq!(c, "ello orld");Á< 
񤞠
úÔ¦ 
 ### Past total length:ÁÅ 
úœÍ 
 ```should_panicÁüå %
񝁭4
1 let mut c = CompactString::from("hello there!");Á”È¡
 c.remove(100);Á<ß¡
ñ¤ë¡
úìó¡
 ### Not on char boundary:Á•¢
úœ¢
œÄüµ¢%
±¥üߢ,
) let mut c = CompactString::from("🦄");Á£
c.remove(1);Á<¥£
ñ¤4Æ£
ù  ù ÎsÍ Í£
Í
æ$Ò£
idxÁØ£
üŠ­0
ü¿©<
9 Forces the length of the [`CompactString`] to `new_len`.Á€ª
úüˆªR
O This is a low-level operation that maintains none of the normal invariants forÁüߪZ
W `CompactString`. If you want to modify the `CompactString` you should use methods likeÁü¾«
 `push`, `push_str` or `pop`.Áã«
údë«
Û§üü«:
7 * `new_len` must be less than or equal to `capacity()`Áü»¬<
9 * The elements at `old_len..new_len` must be initializedÁ<˜­
ú  ú ÎsÍ  ­
Í
ç$¥­
new_lenÁ<«­
ü‘²'
üè­C
@ Returns whether or not the [`CompactString`] is heap allocated.硨
út¸®
©¤|Ë®
ÛÉ<ß®
ñ¤üë®%
±¥ü•¯2
/ let hello = CompactString::new("hello world");Á̯
úüÔ¯(
% assert!(!hello.is_heap_allocated());Á<°
ñ¤°
ú´•°
¼™<°°
ñ¤ü¼°%
±¥üæ°Z
W let msg = CompactString::new("this message will self destruct in 5, 4, 3, 2, 1 💥");Áű
úüͱ%
" assert!(msg.is_heap_allocated());Á<÷±
ñ¤Œ˜²
û  û ÎsÍ ª²
Í
è$«²
ü´H
d“´
ü  ü Îs»'Í»'êê  ´
ÍÍì£Ò¼®´
¤#£Ò”³´
é£Ò$¡´
rangeÁ,§´
8:¼Œµ
lµ

ëüÃÂS
üó»9
6 Removes the specified range in the [`CompactString`],Áü±¼*
' and replaces it with the given string.Áüà¼E
B The given string doesn't need to be the same length as the range.Áª½
úd²½
Öý
úü˽F
C Panics if the starting point or end point do not lie on a [`char`]Áü–¾*
' boundary, or if they're out of bounds.Áž
út;
©¤à¾
ú„è¾
̤ý¾
ú<…¿
ñ¤ü‘¿%
±¥ü»¿4
1 let mut s = CompactString::new("Hello, world!");Áô¿
úüü¿$
! s.replace_range(7..12, "WORLD");Áü¥À#
assert_eq!(s, "Hello, WORLD!");ÁÍÀ
úüÕÀ#
s.replace_range(7..=11, "you");ÁüýÀ!
 assert_eq!(s, "Hello, you!");Á£Á
úü«Á;
8 s.replace_range(5.., "! Is it me you're looking for?");ÁüëÁ9
6 assert_eq!(s, "Hello! Is it me you're looking for?");Á<©Â
ñ¤lÊÂ
ý þ  ý Îs£Ò þ Í»'íí ØÂ
ÍÔÒ¼êÂ
æÒ”ïÂ
ì£Ò$ÝÂ
ŒÒ,ãÂ
 replace_withÁdƒÃ
>@üüÆZ
¼†Ç
ÿ   ÿ Îs  Í žÇ
Í
î$£Ç
¹,©Ç
þ·Ç
ÿÚdÃÇ
üªÉW
¤´É
    Îs  Í ÉÉ
Í
ï$ÎÉ
¹,ÔÉ
þâÉ
ÿÚdîÉ
üøÏU
”‚Ð
ƒ   ƒ Îs  Í •Ð
Í
ð$šÐ
¹, Ð
þ®Ð
ÿÚdºÐ
ü§Û*
ü¿Ö7
4 Truncate the [`CompactString`] to a shorter length.ÁûÖ
úüƒ×^
[ If the length of the [`CompactString`] is less or equal to `new_len`, the call is a no-op.Áæ×
úüî×P
M Calling this function does not change the capacity of the [`CompactString`].ÁÃØ
údËØ
ÖÜØ
úüäØL
I Panics if the new end of the string does not lie on a [`char`] boundary.ÁµÙ
út½Ù
©¤ÐÙ
ú„ØÙ
̤íÙ
ú<õÙ
ñ¤üÚ%
±¥ü«Ú4
ÀÖ”äÚ
 s.truncate(5);ÁÜûÚ
 assert_eq!(s, "Hello");Á<›Û
ñ¤D®Û
   ÎsÍ ·Û
Í
ñ$¼Û
„Ì<ÂÛ
ü¢Þ!
üÝÝ2
/ Converts a [`CompactString`] to a raw pointer.Á4©Þ
   Îs Í °Þ
Í
ò$±Þ
üÁß'
üôÞ:
7 Converts a mutable [`CompactString`] to a raw pointer.ÁTÈß
   Îs Í Óß
Í
ó$Øß
ü×â6
üªà(
% Insert string character at an index.Á×à
útßà
©¤òà
ú„úà
̤á
ú<—á
ñ¤ü£á%
±¥üÍá-
* let mut s = CompactString::new("Hello!");Áüÿá
 s.insert_str(5, ", world");Áü£â#
assert_eq!(s, "Hello, world!");Á<Ëâ
ñ¤TÞâ
ˆ   ˆ Îs  Í éâ
Í
ô$îâ
·Çôâ
stringÁ4€ã
ü—ì.
üóé#
Insert a character at an index.Á›ê
út£ê
©¤¶ê
ú„¾ê
̤Óê
ú<Ûê
ñ¤üçê%
±¥ü‘ë3
0 let mut s = CompactString::new("Hello world!");Á¬Éë
 s.insert(5, ',');Áüãë#
²è<‹ì
ñ¤4žì
Š  Š ÎsÍ ¥ì
Í
õ$ªì
·Ç°ì
èµ¼ì
ýì
õõ¼Ùð
üŽí8
5 Reduces the length of the [`CompactString`] to zero.ÁËí
úüÓíP
Žà¨î
ú<°î
ñ¤ü¼î%
±¥üæîX
U let mut s = CompactString::new("Rust is the most loved language on Stackoverflow!");ÁüÃï!
 assert_eq!(s.capacity(), 49);Áéï
útñï
s.clear();Á„ð
ú´Œð
 assert_eq!(s, "");Áü§ð!
çî<Íð
ñ¤,àð
   ÎsÍ æð
Í
÷$ëð
üŽõ.
ü¢ñ=
: Split the [`CompactString`] into at the given byte index.Áäñ
úüìñP
ŽàÁò
údÉò
ÖÚò
úüâò7
4 Panics if `at` does not lie on a [`char`] boundary.Ážó
ú„¦ó
̤»ó
ú<Ãó
ñ¤üÏó%
±¥üùó4
ÀÖü²ô+
( assert_eq!(s.split_off(5), ", world!");ÁÜâô
òâ<‚õ
ñ¤L•õ
Œ  Œ ÎsÎsÍ Ÿõ
Í
ø$¤õ
at绛
üáýD
ü÷L
I Remove a range from the [`CompactString`], and return it as an iterator.ÁÒ÷
úüÚ÷P
Žà¯ø
úd·ø
ÖÈø
úüÐøP
M Panics if the start or end of the range does not lie on a [`char`] boundary.Á¥ù
út­ù
©¤Àù
ú„Èù
̤Ýù
ú<åù
ñ¤üñù%
±¥ü›ú4
ÀÖÔú
úüÜú
 let mut d = s.drain(5..12);Áü€ûI
F assert_eq!(d.next(), Some(',')); // iterate over the extracted dataÁüÎûF
C assert_eq!(d.as_str(), " world"); // or get the whole data as &str窟
úü¡üQ
N // The iterator keeps a reference to `s`, so you have to drop() the iterator,Áü÷ü'
$ // before you can access `s` again.Ád£ý
drop(d);Áä´ý
 assert_eq!(s, "Hello!");Á<Õý
ñ¤,èý
   Îs£Ò¡¡Ê4£ß4¤¹¥þ¦…5²°AT¬¥  Í»'úú îý
ÍÔÒ¼€þ
æÒ”…þ
ù£Ò$óý
ŒÒ,ùý
)+ü¸†0
ü‚€F
C Shrinks the capacity of this [`CompactString`] with a lower bound.ÁÍ€
úüÕ€H
E The resulting capactity is never less than the size of 3×[`usize`],Áü¢*
' i.e. the capacity than can be inlined.ÁÑ
ú
©¤ì
ú„ô
̤‰‚
ú<‘‚
ñ¤ü%
±¥üÇ‚2
/ let mut s = CompactString::with_capacity(100);Áüþ‚"
 assert_eq!(s.capacity(), 100);Á¥ƒ
úü­ƒP
M // if the capacity was already bigger than the argument, the call is a no-opÁ¬‚„
 s.shrink_to(100);Áüœ„"
ÅÿÄ
ú¤Ë„
 s.shrink_to(50);Áüä„!
 assert_eq!(s.capacity(), 50);ÁŠ…
úü’…*
' // if the string can be inlined, it isÁ¤Á…
 s.shrink_to(10);ÁüÚ…?
< assert_eq!(s.capacity(), 3 * std::mem::size_of::<usize>());Á<ž†
ñ¤L¿†
Ž  Ž ÎsÍ Ɇ
Í
û$Ά
àþdÔ†
üöŽ
üž‡G
D Shrinks the capacity of this [`CompactString`] to match its length.Áê‡
úüò‡H
 ýü¿ˆ*
óýîˆ
úüöˆK
H This method is effectively the same as calling [`string.shrink_to(0)`].ÁƉ
útΉ
©¤á‰
ú„é‰
̤þ‰
ú<†Š
ñ¤ü’Š%
±¥ü¼ŠV
S let mut s = CompactString::from("This is a string with more than 24 characters.");Á—‹
úœŸ‹
 s.reserve(100);Áü·‹!
 assert!(s.capacity() >= 100);ÁÝ‹
ú¼å‹
 s.shrink_to_fit();ÁüŒ&
# assert_eq!(s.len(), s.capacity());Á<¬Œ
񤸌
ú<ÀŒ
ñ¤üÌŒ%
±¥üöŒ4
1 let mut s = CompactString::from("short string");Á¯
úœ·
§‡üÏ!
Ňõ
ú´ý
 s.shrink_to_fit();Áü˜Ž?
¿‚<ÜŽ
ñ¤lýŽ
   ÎsÍ 
Í
ü$
üÓ”A
üÀ;
8 Retains only the characters specified by the predicate.Á
úüˆT
Q The method iterates over the characters in the string and calls the `predicate`.Áá
úüéH
E If the `predicate` returns `false`, then the character gets removed.Áü¶‘B
? If the `predicate` returns `true`, then the character is kept.Áý‘
út…’
©¤˜’
ú
ñ¤ü¬’%
±¥üÖ’3
0 let mut s = CompactString::from("äbð„žd€");ÁŽ“
úü–“0
- let keep = [false, true, true, false, true];ÁüË“
 let mut iter = keep.iter();Áüï“(
% s.retain(|_| *iter.next().unwrap());Áœ”
úô¤”
 assert_eq!(s, "bð„žâ‚¬");Á<Ç”
ñ¤4Ú”
   Îs”*Í”*þþ á”
ÍÍìý‘Äû”
“"ý‘³’œ€•
ý‘³’˜"$
ýý‘$æ”
 predicateÁLð”
SUü£(
üª›J
G Decode a bytes slice as UTF-8 string, replacing any illegal codepointsÁù›
útœ
©¤”œ
ú<œœ
ñ¤ü¨œ%
±¥üÒœ+
( let chess_knight = b"\xf0\x9f\xa8\x84";Á
ú
assert_eq!(Á
"🨄",Áü²5
2 CompactString::from_utf8_lossy(chess_knight),Á
 );Á÷
úüÿ3
0 // For valid UTF-8 slices, this is the same as:Á|·ž
„”|Ëž
üßžG
D CompactString::new(std::str::from_utf8(chess_knight).unwrap()),Á4«Ÿ
ö”<¶Ÿ
ñ¤Ÿ
ú¤ÊŸ
 Incorrect bytes:ÁãŸ
ú<ëŸ
ñ¤ü÷Ÿ%
±¥ü¡ %
" let broken = b"\xf0\x9f\xc8\x84";ÁË 
ú|Ó 
„”„ç 
"�Ȅ",Áüü /
, CompactString::from_utf8_lossy(broken),Á4°¡
ö”»¡
úüáF
C // For invalid UTF-8 slices, this is an optimized implemented for:Á|Ž¢
„”„¢¢
û—ü·¢=
: CompactString::from(String::from_utf8_lossy(broken)),Á4ù¢
ö”<„£
ñ¤|—£
   ‡£ÎsÍ ª£
Í
ÿÁ §£
üã
LÆ£
      ‡£ÉL Û¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙ ‡£У
ù$á£
àù›¤
! ­¤
Äݤ
\ã¤
×ÄÌœ¥
d©¥
 ¶¥
Ò¨
 ȥ
á¥
 , ɥ
8·ÇÊ¥
& ͥ
8«<Î¥
$ Õ¥
, ×¥
8ŒÒ,Ø¥
& ݥ
8ò
Þ¥
*ã¥
 æ¥
è
 ç¥
¨
8ý¥
8¦
8´ …¦
‡¦
8ù$‰¦
 ¦
8ƒ,ަ
 “¦
”¦
% •¦
8,«¦
8´ ±¦
 ²¦
8ó $³¦
 ·¦
¸¦
 º¦
°¨
8Û$Ô¦
 ئ
Û¦
 Ù¦
8® Ú¦
8ݦ
8matchesÁ<à¦
 ç¦
 è¦
ò¦
8® é¦
$ ê¦
, ì¦
8ŒÒ,í¦
*ô¦
 ÷¦
ã§

8àù•§
 ˜§
§
, ™§
8·Çš§
 ٤
8® ¡§
% ¢§
ˤ
8ù$Á§
Ƨ
8´ ȧ
% ɧ
8 ý§
*ÿ§
84‚¨
8Û$‰¨
 ¨
™¨
8é*\ލ
$ š¨
% Ĩ
Äá¨
\î¨
 ú¨
֩
 Ω
™©
, ©
8·ÇŽ©
& ‘©
8«<’©
*›©
 ž©
è©
 Ÿ©
ç©
8§'dµ©
 Á©
 ©
Ô©
, é
8·ÇÄ©
$ Ç©
70x80Á$É©
#Í©
70xBFÁ$Щ
% Õ©
% é©
Ĺ
ÿÿü ¼
\£¼
   ‡£¯+Ê+ú†Í¯+ˆÊ+ˆ »¼
ÍÍì–¦œÔ¼
Í웦¼ý¼
"–¦tÙ¼
–¦‡§˜"ä¼
"›¦”‚½
›¦´§˜"‘½
–¦›¦Á ¸¼
from_intÁDʼ

from_bytesÁTñ¼
¹»´ н
­Ä
Îç…‘–¦›¦³ª³ªDecodeUtf16ErrorÁ´ªcodeÁÕ1£Ì¿Ã.ÍQ„¨ÙÇ
Ό猅‘ŒŒŒ–¦›¦¦©ü¹È
Œ¼È
   ‡£–¦›¦Îsͯ+ŽÊ+Ž ÚÈ
ÍئœóÈ
ꦼœÉ
ü¦tøÈ
դă
©§”¡É
ͧ°É
–¦›¦Á ×È
û¦DéÈ
Œ§TÉ
\^`b ©É
üÔÚD
üœÖG
D Decode a slice of bytes as UTF-16 encoded string, in little endian.ÁèÖ
údðÖ
# ErrorsÁ×
úü‰×^
[ If the slice has an odd number of bytes, or if it did not contain valid UTF-16 characters,Áüì×!
 a [`Utf16Error`] is returned.Á’Ø
útšØ
©¤­Ø
ú<µØ
ñ¤üÁØ%
±¥üëØK
H const DANCING_MEN: &[u8] = b"\x3d\xd8\x6f\xdc\x0d\x20\x42\x26\x0f\xfe";Áü»ÙH
E let dancing_men = CompactString::from_utf16le(DANCING_MEN).unwrap();ÁüˆÚ-
* assert_eq!(dancing_men, "👯â€â™‚ï¸");Á<ºÚ
ñ¤dÛÚ
º,ú†Íº,ÍÍìDZ„ëÚ
àDZ‡£\ðÚ
DZÁ èÚ
,.ü´àD
ü÷ÛD
A Decode a slice of bytes as UTF-16 encoded string, in big endian.ÁÀÜ
údÈÜ
ʬÙÜ
úüáÜ^
î¬üÄÝ!
×­êÝ
útòÝ
©¤…Þ
ú<Þ
ñ¤ü™Þ%
±¥üÃÞM
J const DANCING_WOMEN: &[u8] = b"\xd8\x3d\xdc\x6f\x20\x0d\x26\x40\xfe\x0f";Áü•ßL
I let dancing_women = CompactString::from_utf16be(DANCING_WOMEN).unwrap();Áüæß/
, assert_eq!(dancing_women, "👯â€â™€ï¸");Á<šà
ñ¤d»à
DZú†Íº,Íð±„Ëà
‚²\Ðà
DZÁ Èà
 "üÒç6
ü×áM
J Lossy decode a slice of bytes as UTF-16 encoded string, in little endian.穉
úü±â]
Z In this context "lossy" means that any broken characters in the input are replaced by theÁü“ã[
X \<REPLACEMENT CHARACTER\> `'�'`. Please notice that, unlike UTF-8, UTF-16 is not selfÁüóãX
U synchronizing. I.e. if a byte in the input is dropped, all following data is broken.ÁÐä
útØä
©¤ëä
ú<óä
ñ¤üÿä%
±¥ü©å2
/ // A "random" bit was flipped in the 4th byte:ÁüàåK
H const DANCING_MEN: &[u8] = b"\x3d\xd8\x6f\xfc\x0d\x20\x42\x26\x0f\xfe";Áü°æE
B let dancing_men = CompactString::from_utf16le_lossy(DANCING_MEN);Áüúæ9
6 assert_eq!(dancing_men, "�\u{fc6f}\u{200d}♂ï¸");Á<¸ç
ñ¤”Ùç
DZÎsͺ,Íð±„ïç
‚²\ôç
DZÁ ìç
 "üæî6
üíèJ
G Lossy decode a slice of bytes as UTF-16 encoded string, in big endian.Á¼é
úüÄé]
ö¶ü¦ê[
Þ·ü†ëX
ĸãë
útëë
©¤þë
ú<†ì
ñ¤ü’ì%
±¥ü¼ì2
/ // A "random" bit was flipped in the 9th byte:ÁüóìM
J const DANCING_WOMEN: &[u8] = b"\xd8\x3d\xdc\x6f\x20\x0d\x26\x40\xde\x0f";ÁüÅíI
F let dancing_women = CompactString::from_utf16be_lossy(DANCING_WOMEN);Áü“î4
1 assert_eq!(dancing_women, "👯\u{200d}♀�");Á<Ìî
ñ¤”íî
DZÎsͺ,˜˜Í𱄃ï
‚²\ˆï
DZÁ €ï
 "ü™ò"
üð4
1 Convert the [`CompactString`] into a [`String`].Áºð
útÂð
©¤Õð
ú<Ýð
ñ¤üéð%
±¥ü“ñ.
+ let s = CompactString::new("Hello world");ÁäÆñ
 let s = s.into_string();Áüçñ!
 assert_eq!(s, "Hello world");Á<ò
ñ¤\ ò
Îs–sÍÍ
$¬ò
ü³‰,
üæòE
B Convert a [`String`] into a [`CompactString`] _without inlining_.硗
úü¸ó[
X Note: You probably don't need to use this method, instead you should use `From<String>`Áü˜ô/
, which is implemented for [`CompactString`].ÁÌô
úüÔô^
[ This method exists incase your code is very sensitive to memory allocations. Normally whenÁü·õ]
Z converting a [`String`] to a [`CompactString`] we'll inline short strings onto the stack.Áü™ö]
Z But this results in [`Drop`]-ing the original [`String`], which causes memory it owned onÁüûö_
\ the heap to be deallocated. Instead when using this method, we always reuse the buffer thatÁüß÷T
Q was previously owned by the [`String`], so no trips to the allocator are needed.Á¸ø
útÀø
©¤Óø
ú¬Ûø
 ### Short StringsÁ<õø
ñ¤üù#
¥Ò©ù
úü±ù*
' let short = "hello world".to_string();Áüàù:
7 let c_heap = CompactString::from_string_buffer(short);ÁŸú
úü§ú[
X // using CompactString::from_string_buffer, we'll re-use the String's underlying bufferÁü‡û(
% assert!(c_heap.is_heap_allocated());Á´û
úü¼û]
Z // note: when Clone-ing a short heap allocated string, we'll eagerly inline at that pointÁüžü"
 let c_inline = c_heap.clone();ÁüÅü+
( assert!(!c_inline.is_heap_allocated());Áõü
úüýü!
 assert_eq!(c_heap, c_inline);Á<£ý
ñ¤¯ý
ú´·ý
 ### Longer StringsÁ<Òý
ñ¤üÞý#
¥Ò†þ
úüŽþA
> let x = "longer string that will be on the heap".to_string();ÁüÔþ$
! let c1 = CompactString::from(x);Áýþ
úü…ÿA
> let y = "longer string that will be on the heap".to_string();ÁüËÿ2
/ let c2 = CompactString::from_string_buffer(y);Á‚€
úüŠ€Q
N // for longer strings, we re-use the underlying String's buffer in both casesÁüà€$
! assert!(c1.is_heap_allocated());Áü‰$
! assert!(c2.is_heap_allocated());Á
ñ¤¾
ú¬Æ
 ### Buffer Re-useÁ
ñ¤üì#
¥Ò”‚
úüœ‚'
$ let og = "hello world".to_string();ÁôÈ‚
 let og_addr = og.as_ptr();Áë‚
úüó‚6
3 let mut c = CompactString::from_string_buffer(og);Á쮃
 let ex_addr = c.as_ptr();ÁЃ
úü؃`
] // When converting to/from String and CompactString with from_string_buffer we always re-useÁü½„2
/ // the same underlying allocated memory/bufferÁüô„!
 assert_eq!(og_addr, ex_addr);Áš…
úü¢…L
I let long = "this is a long string that will be on the heap".to_string();Áüó…"
 let long_addr = long.as_ptr();Áš†
úü¢†/
, let mut long_c = CompactString::from(long);ÁüÖ†'
$ let long_ex_addr = long_c.as_ptr();Á‚‡
úüЇ`
] // When converting to/from String and CompactString with From<String>, we'll also re-use theÁüï‡^
[ // underlying buffer, if the string is long, otherwise when converting to CompactString weÁ¬Òˆ
 // eagerly inlineÁüìˆ(
% assert_eq!(long_addr, long_ex_addr);Á<™‰
ñ¤”º‰
–sÎsÍÍ
š¾ ͉
ô·Š
Îsœ´œ¤êŠ
<íŠ
Îs
œä©‹
ÎsžŸê!ë!Ÿ\Ì‹
4Ñ‹
¼ò‹
,õ‹
   Îs   û‹

Ÿ$ü‹
ü«Œ
Îs¡÷!¡üߌ#
LâŒ
   Îs    ìŒ
 
¡$ñŒ
ü¨!
Îs£â£ÄÞ

˜  ˜ Îs ˜ ¢ è
¢
£
ü˜Ž#
Îs¥â¥ÔÐŽ
4ÓŽ
   Îs  Å¢¤ ÚŽ
¤
¥$ÛŽ
ü˜"
Îs§â§ÌÏ

š  š Îs 𠇣¦ Ù
¦
§
üŒ"
Îs©¢©ÄÃ

   Îs  ¨ Í
¨
©
üý%
Îs«¥«ü·‘$
Tº‘
œ  œ Îs œ ª Å‘
ª
«$Ê‘
Ì
ÎsüŸ’2
¥®®‹¸ ¤’
Þ×T§’
Îs¯·ß¯üØ’
Û’
 ž   Îs ž ô¡­ Þ’
­
¯ô¡$ß’
¹
,å’
ü«“(
–s±·ß±üÚ“+
Ý“
Ÿ    Ÿ –s   Îs° à“
°
±$á“
¹
,ç“
ü¹”&
8¡ ¡ Ò£³·ß³üæ”+
é”
¢ £  ¢ Ò£ £ Îs² ì”
²
³8$í”
¹
,ó”
ü½•2
éµµ‰t¶·ß•
üö•+
ù•
¤ ¥  ¤ ‰t ¥ Îs´ ü•
´
é$ý•
¹
,ƒ–
ÔÍ–
Îs¸»¸üî–'
ñ–
¦ §  ¦ Îs § Îs¿ßÀßÁßLessÁÂßÃßÄß~Å߯ßÇßGreaterÁÈßåºÝÈnûê7· õ–
·
¸$ö–
¹
,ü–
üË—!
Îsºïߺüó—7
\ö—
¨ ©  ¨ Îs © ÎsÛ¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙîì¹ ‚˜
¹
º$ƒ˜
¹
,‰˜
ÜÔ˜
Îs¼›e¼üö˜(
$ù˜
ª «  ª Îs « »½½ ‰™
»Íì°ð þ˜
¢e°ð4
¼°ð$Š™
º,
02üÌ™(
é¿¿ÎsÀëÀÑ™
Üû™
$þ™
ŠrÎs¾¾
Àé¾ ƒš
üßš#
ÎsÂëÂÔ‰›
$Œ›
–sÎsÁÁ
¾ ‘›
üú›+
éÄÄÎsÅëÅÿ›
ô¬œ
$¯œ
±¤ÎsÃÃ
Åé¾ ´œ
üôœ-
éÇÇÎsÈëÈùœ
ü¨"

‰tÎsÆÆ
ÈécowÁ°
ü£Ÿ%
ÎsÊëÊäÏŸ
$ÒŸ
rÎsÉÉ
Ê­ ן
üã #
–sÌëÌü›¡!
$ž¡
Îs–sËË
̾ £¡
üà¡)
8¬ ¬ é¤ÎëÎüž¢!
$¡¢
Îsé¤ÍÍ
Î8¾ ¦¢
üð¢1
éÐЉtÑëÑõ¢
ü¶£%
$¹£
Å¥‰tÏÏ
Ñé¾ ¾£
ô¤
ÎsÓÔðyñyÔD¦¤
«¤
ÒÒˆê)?ÈXM´­üФ8
DÓ¤
­  ­ Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
ÎsÎsðyÒ ߤ
Ò
Ô¾ ܤ
ü·¥!
ÎsÖÀcÖüߥ8
â¥
® ¯ °  ® Îs ¯  c cˆ¢cµ
 `£càù `àB¤GS
° Ö¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
ŸÈŸÈ ÈErrorÁ O˜éBLÕ æ¥
Õ
Ö$ç¥
± í¥
üͦ#
ÎsØÅcØü÷¦8
ú¦
± ² ³  ± Îs ²  c cˆ¢cµ
 `£càù `àB¤GS
³ áû× þ¦
×
Ø$ÿ¦
± …§
üç§)
ÎsÚÅLÚü—¨;
Lš¨
ô¡ÎsÙ¥ÛÛÙ‹¸ ¤¨
œ¸̧¨
¬¸\´¨
Úô¡ù$¨
)+ü©©1
éÝÝÎsÞÅLÞ®©
üá©?
Lä©
«¹ÎsÜ¥ßßÜÓ¹ î©
ä¹ìñ©
ô¹|þ©
Þ髹ù$ª
/1ü÷ª0
éááÎsâÅLâüª
ü®«>
L±«
«¹Îsà¥ããàÓ¹ »«
ä¹侫
±½tË«
â髹ù$Ü«
/1üì-
ÎsåÅLåü÷¬?
Lú¬
ô¡Îs䥿æä‹¸ „­
œ¸쇭
Ù¾|”­
åô¡ù$¦­
)+ü®5
éèèÎséÅLé’®
üÉ®C
LÌ®
«¹Îsç¥êêçÓ¹ Ö®
ä¹üÙ®!
Õœæ®
é髹ù$ü®
02üã¯+
ÎsìÅLìü•°=
L˜°
ô¡Îsë¥íí닸 ¢°
œ¸Ü¥°
û¿l²°
ìô¡ù$°
)+ü©±2
ÎsïÅLïüâ±D
Lå±
ô¡Îsî¥ðð ï±
œ¸üò±"
žÁ¤ÿ±
ïô¡ù$–²
*,üý²+
–sòÅLòü¯³D
L²³
ô¡–sñ¥óóñ‹¸ ¼³
œ¸ü¿³"
žÁ¤Ì³
òô¡ù$ã³
*,ü1
8´ ´ é¤õÅLõüŶD
Lȶ
«¹é¤ô¥ööôÓ¹ Ò¶
ä¹üÕ¶"
«¹ÈLÎs¤â¶
õ8«¹ù$ù¶
9;ü¼·#
ÎsøÒLøüæ·;
4é·
µ  µ Îsô¡÷¥ùù ޏ
÷‹¸ ð·
œ¸Ìó·
¬¸\€¸
øô¡$“¸
ù$™¸
13üɸ+
éûûÎsüÒLüθ
üû¸?
4þ¸
   Îs«¹ú¥ýý §¹
úÓ¹ …¹
ä¹숹
ô¹|•¹
ü髹$¬¹
ù$²¹
79üâ¹*
éÿÿÎs€ÒLç¹
ü“º>
4–º
·  · Îs«¹þ¥ ¾º
þÓ¹ º
ä¹ä º
±½t­º
髹$ú
ù$ɺ
79üùº'
ÎsƒÒLƒü§»?
4ª»
¸  ¸ Îsô¡¥ Ó»
‹¸ ±»
œ¸ì´»
Ù¾|Á»
ƒô¡$Ø»
ù$Þ»
13ü޼/
éÎs‡ÒL“¼
üļC
4Ǽ
¹  ¹ Îs«¹¥ˆˆ ô¼
ӹ μ
ä¹üѼ!
Õœ޼
髹$ù¼
ù$ÿ¼
8:D¬½
Îç…‘«¹Ô› ÎsüÒ½%
Îs‹ÒLüþ½=
4¾
º  º Îsô¡Š¥ŒŒ ¨¾
Š‹¸ ˆ¾
œ¸Ü‹¾
û¿l˜¾
ô¡$­¾
ù$³¾
13üã¾%
–sŽÒLŽü¿D
4’¿
»  » –sô¡¥ À¿
‹¸ ™¿
œ¸üœ¿"
žÁ¤©¿
Žô¡$Å¿
ù$Ë¿
24ü À,
Îs‘ÒLüÓÀD
4ÖÀ
¼  ¼ Îsô¡¥ „Á
‹¸ ÝÀ
œ¸üàÀ"
žÁ¤íÀ
ô¡$‰Á
ù$Á
24üäÁ/
é‰t•ÒLéÁ
üšÂD
4Â
½  ½ ‰t«¹¥ ËÂ
Ó¹ ¤Â
ä¹ü§Â"
µŠ¤´Â
髹$ÐÂ
ù$ÖÂ
8:üŽÃ!
Îs˜ëbîb˜ü¶Ã/
L¹Ã
¾ ¿  ¾ Îs ¿ áû ÃÃ

˜$ÈÃ
¾ ÎÃ
üœÄJ
LŸÄ
À Á  À ÎsäÈäÈÝàæÈðà `çÈÀ `üöMõô]TdÁ áû ³Ä

$­Ä
À$¾Ä
ü«Æ
8  Îs›œÆ Ç œ\ÒÆ
4ׯ
ššÎsüêÆ+
íÆ
à Îs à ÎsÒ£Æ š €Ç
š
œ8$õÆ
rhsÁûÆ
üÊÇ&
8Ä Ä ÎsžÛõžü÷Ç#
TúÇ
Å Æ  Å Îs Æ  …È

ž8$ŠÈ
çœÈ
üãÌ
„¨ Åc üŠÍ8
Í
Ç È É  Ç „¨ È  c cˆ¢cµ
 `£càù `àB¤GS
É áûŸ ‘Í
Ÿ
 $’Í
± ˜Í
¤šÏ
ü“ÎD
A An iterator over the exacted data by [`CompactString::drain()`].Á.üØÎA
1iterators are lazy and do nothing unless consumedÁ,¥Ï
颢¡¡Ê4£ß4¤¹¥þ¦…5²°AT¬¥ é²°AT¬¥ £¤¥¦®«Ï
üµÏ"
tµÏ
¡¡ ÎsdÝÏ
,ÝÏ
¡¡TïÏ
ïÏ
¡¡ÔÿÏ
,ÿÏ
¡¡ÞÏÞÏCharsÁàÏù¯vyÞi®¾ÏžéôæÐ
8Ê Ê é¨ôˆÑ
8Ë Ë é¨ì«Ñ
8Ì Ì é¨ªÀcªüÏÑ8
ÒÑ
Í Î Ï  Í é¨ Î  c cˆ¢cµ
 `£càù `àB¤GS
Ï áû© ÖÑ
©
ª8$×Ñ
± ÝÑ
üÑÒ
8РР騬Åc¬ü…Ó8
ˆÓ
Ñ Ò Ó  Ñ é¨ Ò  c cˆ¢cµ
 `£càù `àB¤GS
Ó áû« ŒÓ
«
¬8$Ó
± “Ó
¼ìÓ
8Ô Ô é¨®"®”˜Ô
$›Ô
Õ  Õ é¨­  Ô
­
®8$¥Ô
t¥×
8Ö Ö é¨°䑨
üº×D
A The remaining, unconsumed characters of the extracted substring.Á4˜Ø
×  × é¨ × ¯ ŸØ
¯
°8$ Ø
ÄÕØ
8Ø Ø é¨²³ê!ë!³\ôØ
4ùØ
±±üšÙ
,Ù
Ù  Ù é¨ Ù é¨ê!± £Ù
±
³8$¤Ù
ÜÜÙ
8Ú Ú é¨µ·¸¹úMûM€NÿMƒN·¹¸LþÙ
$ƒÚ
´´ü£Ú"
$¦Ú
Û  Û é¨´ «Ú
´
8$°Ú
¼ûÚ
,þÚ
騴´
·8$„Û
ü“Ü-
L–Ü
Ü  Ü é¨Û¼ݼÞ¼©ß¼à¼ÛἈcSñŸ«‡zÙ´  Ü
´
¸8$¡Ü
üûÜ!
$þÜ
騴´
¹8$‡Ý
üÇÝ&
8Ý Ý é¨»M»ü‚Þ'
L…Þ
Þ  Þ é¨º Þ
º
»8$”Þ
üÔÞ
8ß ß é¨Ào j{;Ÿ¾¿ÀÀo;%̲Ào½½
¾„ê%½½̲¬^ À<Ào(Æ
=Ào/3=ÀoÄÙÄMOà  à ÀoÀoÃÆÃ
ʬ^( Í>ÀoÇÀcÇ!#á â ã  á Ào â  c cˆ¢cµ
 `£càù `àB¤GS
ã áûÆ ÍÆ
ÇıÊH
Ô?Ào?ÀoÊ·ßÊ57ä å  ä Ào å ÀoÉ
ÔÉ
ʹ
 ß@ÀoÌÌ!'<æ  æ ÀoË ßË
̬^iÚ  à %úÀê ÎÎÏçÏ…‘ÏÏζÁiï õ%úÀÿÐÎÑçÑ…‘ÑÑÐËÂá
A
\aö`ÑÑiÚ  à 4úÀê ÕÎÖçÖ…‘ÖÖÕ¬Ïi*Ú lúÀ×ÎØçØ…‘ØØ×ÔÒŒâ  ítìº-Ï6:mÚÛÝÞàáãäæçéêìíïðòóõöøùûüþÿˆŠŽšœŸ ¢£¥¦¨©«¬®¯±²´µ·¸º»½¾ÀÁÃÄÆÇÉÊÌÍÏÐÒÓÕÖØÙÛÜÞßáâäåçèêëíîðñóôö÷ùúüýÿƒˆŒŽ˜šž ¡£¤¦§©ª¬­¯°²³µ¸¹»¼¾¿ÁÂÄÅÇÈÊËÍÎÐÑÓÔÖ×ÙÚÜÝßàâãåæèéëìîïñòôõ÷øúûýþƒŠŒ˜œžŸ¡¢¤¥§¨ª«­®°±³´·¹º¼½¿ÀÂÃÅÆÈÉËÌÎÏÑÒÔÕרÚÛÝÞàáãäæçéêìíïðòóõöøùûüþÿˆŠŽšœŸ ¢£¥¦¨©«¬®¯±²´µ·¸º»½¾ÀÁÃÄÆÇÉÊÌÍÏÐÒÓÕÖØÙÛÜÞßáâäåçèêëíîðñóôö÷ùúüýÿ€ ‚ ƒ … † ˆ ‰ ‹ Œ Ž ” • — ˜ š ž   ¡ £ ¤ ¦ § © ª ¬ ­ ¯ ° ² ³ µ ¶ ¸ ¹ » ¼ ¾ ¿ Á Â Ä Å Ç È Ê Ë Í Î Ð Ñ Ó Ô Ö × Ù Ú Ü Ý ß à â ã å æ è é ë ì î ï ñ ò ô õ ÷ ø ú û ý þ €
ƒ
Š
Œ
˜
œ
ž
Ÿ
¡
¢
¤
¥
§
¨
ª
«
­
®
°
±
³
´
·
¹
º
¼
½
¿
À
Â
Ã
Å
Æ
È
É
Ë
Ì
Î
Ï
Ñ
Ò
Ô
Õ
ÜÛßÞâáåäèçëêîíñðôó ÷ö
úù ýü ÿ
ƒˆŒŽ˜šž¡ ¤£§¦ª©­¬°¯³²µ¹¸ ¼»!¿¾"ÂÁ#ÅÄ$ÈÇ%ËÊ&ÎÍ'ÑÐ(ÔÓ)×Ö*ÚÙ+ÝÜ,àß-ãâ.æå/éè0ìë1ïî2òñ3õô4ø÷5ûú6þý78ƒ9:Š;Œ<=>?˜@œAŸžB¢¡C¥¤D¨§E«ªF®­G±°H´³I·Jº¹K½¼LÀ¿MÃÂNÆÅOÉÈPÌËQÏÎRÒÑSÕÔTØ×UÛÚVÞÝWáàXäãYçæZêé[íì\ðï]óò^öõ_ùø`üûaÿþbcdˆeŠfŽghijškœl Ÿm£¢n¦¥o©¨p¬«q¯®r²±sµ´t¸·u»ºv¾½wÁÀxÄÃyÇÆzÊÉ{ÍÌ|ÐÏ}ÓÒ~ÖÕÙØÜÛßÞâáƒåäèçëêîíñðˆôó÷öŠúùýüŒÿƒŽˆŒŽ˜šž¡ ˜¤£§¦šª©­¬œ°¯³²žµŸ¹¸ ¼»¡¿¾¢ÂÁ£ÅĤÈÇ¥ËʦÎͧÑШÔÓ©×ÖªÚÙ«Ýܬàß­ãâ®æå¯éè°ìë±ïî²òñ³õô´ø÷µûúþý· ¸ƒ ¹ºŠ » Œ ¼  ½¾¿˜ Àœ ÁŸ ž ¢ ¡ Ã¥ ¤ Ĩ § Å« ª Æ® ­ DZ ° È´ ³ É· ʺ ¹ ˽ ¼ ÌÀ ¿ Íà  ÎÆ Å ÏÉ È ÐÌ Ë ÑÏ Î ÒÒ Ñ ÓÕ Ô ÔØ × ÕÛ Ú ÖÞ Ý ×á à Øä ã Ùç æ Úê é Ûí ì Üð ï Ýó ò Þö õ ßù ø àü û áÿ þ â

ã

äˆ

å
Š
æŽ

ç

è

é

êš

ë
œ
ì 
Ÿ
í£
¢
î¦
¥
ï©
¨
ð¬
«
ñ¯
®
ò²
±
óµ
´
ô¸
·
õ»
º
ö¾
½
÷Á
À
øÄ
Ã
ùÇ
Æ
úÊ
É
ûÍ
Ì
üÐ
Ï
ýÓ
Ò
þÖ
Õ
ú ÙÙítÙÙít ÿ  ÙÙítÙÙít   ÙÙítÙÙít  ž ÙÙítÙÙít £ ª ÙÙítÙÙít ¯  ÙÙítÙÙít »  ÙÙítÙÙít Ç Î ÙÙítÙÙít Ó Ú ÙÙítÙÙít ß æ ÙÙítÙÙít ë ò ÙÙítÙÙítø  ÙÙítÙÙít Ž ÙÙítÙÙít œ ÙÙítÙÙít¢ ª ÙÙítÙÙít° ¸ ÙÙítÙÙít¾ Æ ÙÙítÙÙítÌ Ô ÙÙítÙÙítÚ â ÙÙítÙÙítè ð ÙÙítÙÙítö þ ÙÙítÙÙít Œ ÙÙítÙÙít š ÙÙítÙÙít  ¨ ÙÙítÙÙít®  ÙÙítÙÙít¼ Ä ÙÙítÙÙítÊ Ò ÙÙítÙÙítØ à ÙÙítÙÙítæ î ÙÙítÙÙítô ü ÙÙítÙÙít Š ÙÙítÙÙít ˜ ÙÙítÙÙítž ¦ ÙÙítÙÙít¬ ´ ÙÙítÙÙítº  ÙÙítÙÙítÈ Ð ÙÙítÙÙítÖ Þ ÙÙítÙÙítä ì ÙÙítÙÙítò ú ÙÙítÙÙít ˆ ÙÙítÙÙítŽ  ÙÙítÙÙítœ ¤ ÙÙítÙÙítª ² ÙÙítÙÙít¸ À ÙÙítÙÙítÆ Î ÙÙítÙÙítÔ Ü ÙÙítÙÙítâ ê ÙÙítÙÙítð ø ÙÙítÙÙítþ  ÙÙítÙÙítŒ  ÙÙítÙÙítš ¢ ÙÙítÙÙít¨ ° Ù
ÙÙítÙÙítŠ

ÙÙítÙÙít˜
 
ÙÙítÙÙít¦
®
ÙÙítÙÙít´
¼
ÙÙítÙÙítÂ
Ê
ÙÙítÙÙítÐ
Ø
ÙÙítÙÙítÞ
æ
ÙÙítÙÙítì
ô
ÙÙítÙÙítú
 ÙÙítÙÙítˆ  ÙÙítÙÙít ž ÙÙítÙÙít¤ ¬ ÙÙítÙÙít² º ÙÙítÙÙítÀ È ÙÙítÙÙítÎ Ö ÙÙítÙÙítÜ ä ÙÙítÙÙítê ò ÙÙítÙÙítø  ÙÙítÙÙít Ž ÙÙítÙÙít œ ÙÙítÙÙít¢ ª ÙÙítÙÙít° ¸ ÙÙítÙÙít¾ Æ ÙÙítÙÙítÌ Ô ÙÙítÙÙítÚ â ÙÙítÙÙítè ð ÙÙítÙÙítö þ ÙÙítÙÙít
Œ
ÙÙítÙÙít
š
ÙÙítÙÙít 
¨
ÙÙítÙÙít®

ÙÙítÙÙít¼
Ä
ÙÙítÙÙítÊ
Ò
ÙÙítÙÙítØ
à
ÙÙítÙÙítæ
î
ÙÙítÙÙítô
ü
ÙÙítÙÙít Š ÙÙítÙÙít ˜ ÙÙítÙÙítž ¦ ÙÙítÙÙít¬ ´ ÙÙítÙÙítº Â ÙÙítÙÙítÈ Ð ÙÙítÙÙítÖ  ÙÙítÙÙítå  ÙÙítÙÙítõ  ÙÙítÙÙít  ÙÙítÙÙít  ÙÙítÙÙít¥  ÙÙítÙÙítµ  ÙÙítÙÙítÅ  ÙÙítÙÙítÕ  ÙÙítÙÙítå  ÙÙítÙÙítõ  ÙÙítÙÙít  ÙÙítÙÙít  ÙÙítÙÙít¥  ÙÙítÙÙítµ  ÙÙítÙÙítÅ  ÙÙítÙÙítÕ  ÙÙítÙÙítå 
ÙÚ
MOç  ç ítítÙ
 Ù
Ú
˜(:Î YítÜ
ÀcÜ
!#è é ê  è ít é  c cˆ¢cµ
 `£càù `àB¤GS
ê áûÛ
 Û
Ü
ıÊi;Ú ¡úÀÝ
ÎÞ
çÞ
…‘Þ
Þ
Ý
£… à
Ëà
Ð<°H<³ƒqß
ß
à
 â
Ëâ
Ð@°H@³ƒqá
á
â
 D÷ä
Ëä
ÐD°HD³ƒqã
ã
ä
 H÷æ
Ëæ
ÐH°HH³ƒqå
å
æ
 L÷è
Ëè
ÐL°HL³ƒqç
ç
è
 P÷ê
Ëê
ÐP°HP³ƒqé
é
ê
 T÷ì
Ëì
ÐT°HT³ƒqë
ë
ì
 X÷î
Ëî
ÐX°HX³ƒqí
í
î
 \÷ð
Ëð
Ð\°H\³ƒqï
ï
ð
 `÷ò
Ëò
Ð`°H`³ƒqñ
ñ
ò
 dý'’šô
Ëô
Ðd¶(Hd¹(’šƒqó
ó
ô
 dÃ( eý'Κö
Ëö
Ðe¶(He¹(Κƒqõ
õ
ö
 eÃ( fý'Š›ø
Ëø
Ðf¶(Hf¹(Š›ƒq÷
÷
ø
 fÃ( gý'Æ›ú
Ëú
Ðg¶(Hg¹(Æ›ƒqù
ù
ú
 gÃ( hý' ‚œü
Ëü
Ðh¶(Hh¹(‚œƒqû
û
ü
 hÃ( iý'!¾œþ
Ëþ
Ði¶(Hi¹(¾œƒqý
ý
þ
 iÃ( jý'"úœ Ë Ðj¶(Hj¹(úœƒqÿ
ÿ
 jÃ( ký'# Ë Ðk¶(Hk¹(ƒq 
 kÃ( lý'$ò Ë Ðl¶(Hl¹(òƒqƒ ƒ
 lÃ( mý'%®ž Ë Ðm¶(Hm¹(®žƒq 
 mÃ( ný'&ꞈ ˈ Ðn¶(Hn¹(ꞃq 
ˆ  nÃ( oý''¦ŸŠ ËŠ Ðo¶(Ho¹(¦Ÿƒq 
Š  oÃ(|—8~—8—8—8—8—8ˆ—8Š—8Œ—8Ž—8—8—8—8—8˜—8š—8œ—8ž—8 —8¢—8¤—8¦—8¨—8ª—8¬—8®—8°—8²—8´—8—8üšS
P A [`CompactString`] is a compact string type that can be used almost anywhere aÁüî&
# [`String`] or [`str`] can be used.Á
úä™
 ## Using `CompactString`Á
ñ¤ü¾#
¥Òüâ$
! # use std::collections::HashMap;Á
úü‹Q
N // CompactString auto derefs into a str so you can use all methods from `str`ÁÔÝ
 // that take a `&self`Áüø6
3 if CompactString::new("hello world!").is_ascii() {Áü¯#
println!("we're all ASCII")Á
Ù
úüÝQ
N // You can use a CompactString in collections like you would a String or &strÁü¯ H
E let mut map: HashMap<CompactString, CompactString> = HashMap::new();Áø
úüü /
, // directly construct a new `CompactString`Áü¬
W
T map.insert(CompactString::new("nyc"), CompactString::new("empire state building"));Áü„ -
* // create a `CompactString` from a `&str`Áü² ;
8 map.insert("sf".into(), "transamerica pyramid".into());Áüî /
, // create a `CompactString` from a `String`Áüž P
M map.insert(String::from("sea").into(), String::from("space needle").into());Áï
úüó .
+ fn wrapped_print<T: AsRef<str>>(text: T) {矢
&
# println!("{}", text.as_ref());Á
—’ Ï
úüÓ
Q
N // CompactString impls AsRef<str> and Borrow<str>, so it can be used anywhere矴$
! // that expects a generic stringÁüÊ,
) if let Some(building) = map.get("nyc") {Áü÷
 wrapped_print(building);Á,˜
—’ ž
úü¢F
C // CompactString can also be directly compared to a String or &strÁüé9
6 assert_eq!(CompactString::new("chicago"), "chicago");矣G
D assert_eq!(CompactString::new("houston"), String::from("houston"));Á
ñ¤ó
úü÷
 # Converting from a `String`Áü˜d
a It's important that a `CompactString` interops well with `String`, so you can easily use both inÁœý
 your code base.Á
úü•S
P `CompactString` implements `From<String>` and operates in the following manner:ÁüéC
@ - Eagerly inlines the string, possibly dropping excess capacityÁü­@
= - Otherwise re-uses the same underlying buffer from `String`Áî
ú
ñ¤üú#
¥Òž
ú¼¢
 // eagerly inlining矼,
) let short = String::from("hello world");Áüç-
* let short_c = CompactString::from(short);Áü•*