@@ -787,7 +787,7 @@ library strings {
787787 * @param self The string to make a slice from.
788788 * @return A newly allocated slice containing the entire string.
789789 */
790- function toSlice(string memory self ) internal pure returns(slice memory ) {
790+ function toSlice(string memory self ) internal pure returns (slice memory ) {
791791 uint ptr ;
792792 assembly {
793793 ptr := add (self , 0x20 )
@@ -800,7 +800,7 @@ library strings {
800800 * @param self The value to find the length of.
801801 * @return The length of the string, from 0 to 32.
802802 */
803- function len(bytes32 self ) internal pure returns(uint ) {
803+ function len(bytes32 self ) internal pure returns (uint ) {
804804 uint ret ;
805805 if (self == 0 ) return 0 ;
806806 if (self & 0xffffffffffffffffffffffffffffffff == 0 ) {
@@ -832,7 +832,7 @@ library strings {
832832 * @return A new slice containing the value of the input argument up to the
833833 * first null.
834834 */
835- function toSliceB32(bytes32 self ) internal pure returns(slice memory ret ) {
835+ function toSliceB32(bytes32 self ) internal pure returns (slice memory ret ) {
836836 // Allocate space for \`self\` in memory, copy it there, and point ret at it
837837 assembly {
838838 let ptr : = mload (0x40 )
@@ -848,7 +848,7 @@ library strings {
848848 * @param self The slice to copy.
849849 * @return A new slice containing the same data as \`self\`.
850850 */
851- function copy(slice memory self ) internal pure returns(slice memory ) {
851+ function copy(slice memory self ) internal pure returns (slice memory ) {
852852 return slice (self ._len , self ._ptr );
853853 }
854854
@@ -857,7 +857,7 @@ library strings {
857857 * @param self The slice to copy.
858858 * @return A newly allocated string containing the slice's text.
859859 */
860- function toString(slice memory self ) internal pure returns(string memory ) {
860+ function toString(slice memory self ) internal pure returns (string memory ) {
861861 string memory ret = new string (self ._len );
862862 uint retptr ;
863863 assembly {
@@ -876,7 +876,7 @@ library strings {
876876 * @param self The slice to operate on.
877877 * @return The length of the slice in runes.
878878 */
879- function len(slice memory self ) internal pure returns(uint l ) {
879+ function len(slice memory self ) internal pure returns (uint l ) {
880880 // Starting at ptr-31 means the LSB will be the byte we care about
881881 uint ptr = self ._ptr - 31 ;
882882 uint end = ptr + self ._len ;
@@ -906,7 +906,7 @@ library strings {
906906 * @param self The slice to operate on.
907907 * @return True if the slice is empty, False otherwise.
908908 */
909- function empty(slice memory self ) internal pure returns(bool ) {
909+ function empty(slice memory self ) internal pure returns (bool ) {
910910 return self ._len == 0 ;
911911 }
912912
@@ -919,9 +919,10 @@ library strings {
919919 * @param other The second slice to compare.
920920 * @return The result of the comparison.
921921 */
922- function compare(slice memory self , slice memory other ) internal pure returns(
923- int
924- ) {
922+ function compare(
923+ slice memory self ,
924+ slice memory other
925+ ) internal pure returns (int ) {
925926 uint shortest = self ._len ;
926927 if (other ._len < self ._len ) shortest = other ._len ;
927928
@@ -955,7 +956,7 @@ library strings {
955956 * @param self The second slice to compare.
956957 * @return True if the slices are equal, false otherwise.
957958 */
958- function equals(slice memory self , slice memory other ) internal pure returns(
959+ function equals(slice memory self , slice memory other ) internal pure returns (
959960 bool
960961 ) {
961962 return compare (self , other ) == 0 ;
@@ -968,9 +969,10 @@ library strings {
968969 * @param rune The slice that will contain the first rune.
969970 * @return \`rune\`.
970971 */
971- function nextRune(slice memory self , slice memory rune ) internal pure returns(
972- slice memory
973- ) {
972+ function nextRune(
973+ slice memory self ,
974+ slice memory rune
975+ ) internal pure returns (slice memory ) {
974976 rune ._ptr = self ._ptr ;
975977
976978 if (self ._len == 0 ) {
@@ -1014,7 +1016,9 @@ library strings {
10141016 * @param self The slice to operate on.
10151017 * @return A slice containing only the first rune from \`self\`.
10161018 */
1017- function nextRune(slice memory self ) internal pure returns(slice memory ret ) {
1019+ function nextRune(slice memory self ) internal pure returns (
1020+ slice memory ret
1021+ ) {
10181022 nextRune (self , ret );
10191023 }
10201024
@@ -1023,7 +1027,7 @@ library strings {
10231027 * @param self The slice to operate on.
10241028 * @return The number of the first codepoint in the slice.
10251029 */
1026- function ord(slice memory self ) internal pure returns(uint ret ) {
1030+ function ord(slice memory self ) internal pure returns (uint ret ) {
10271031 if (self ._len == 0 ) {
10281032 return 0 ;
10291033 }
@@ -1074,7 +1078,7 @@ library strings {
10741078 * @param self The slice to hash.
10751079 * @return The hash of the slice.
10761080 */
1077- function keccak(slice memory self ) internal pure returns(bytes32 ret ) {
1081+ function keccak(slice memory self ) internal pure returns (bytes32 ret ) {
10781082 assembly {
10791083 ret := keccak256 (mload (add (self , 32 )), mload (self ))
10801084 }
@@ -1089,7 +1093,7 @@ library strings {
10891093 function startsWith(
10901094 slice memory self ,
10911095 slice memory needle
1092- ) internal pure returns(bool ) {
1096+ ) internal pure returns (bool ) {
10931097 if (self ._len < needle ._len ) {
10941098 return false ;
10951099 }
@@ -1115,9 +1119,10 @@ library strings {
11151119 * @param needle The slice to search for.
11161120 * @return \`self\`
11171121 */
1118- function beyond(slice memory self , slice memory needle ) internal pure returns(
1119- slice memory
1120- ) {
1122+ function beyond(
1123+ slice memory self ,
1124+ slice memory needle
1125+ ) internal pure returns (slice memory ) {
11211126 if (self ._len < needle ._len ) {
11221127 return self ;
11231128 }
@@ -1149,7 +1154,7 @@ library strings {
11491154 function endsWith(
11501155 slice memory self ,
11511156 slice memory needle
1152- ) internal pure returns(bool ) {
1157+ ) internal pure returns (bool ) {
11531158 if (self ._len < needle ._len ) {
11541159 return false ;
11551160 }
@@ -1177,7 +1182,7 @@ library strings {
11771182 * @param needle The slice to search for.
11781183 * @return \`self\`
11791184 */
1180- function until(slice memory self , slice memory needle ) internal pure returns(
1185+ function until(slice memory self , slice memory needle ) internal pure returns (
11811186 slice memory
11821187 ) {
11831188 if (self ._len < needle ._len ) {
@@ -1208,7 +1213,7 @@ library strings {
12081213 uint selfptr ,
12091214 uint needlelen ,
12101215 uint needleptr
1211- ) private pure returns(uint ) {
1216+ ) private pure returns (uint ) {
12121217 uint ptr = selfptr ;
12131218 uint idx ;
12141219
@@ -1262,7 +1267,7 @@ library strings {
12621267 uint selfptr ,
12631268 uint needlelen ,
12641269 uint needleptr
1265- ) private pure returns(uint ) {
1270+ ) private pure returns (uint ) {
12661271 uint ptr ;
12671272
12681273 if (needlelen <= selflen ) {
@@ -1316,7 +1321,7 @@ library strings {
13161321 * @param needle The text to search for.
13171322 * @return \`self\`.
13181323 */
1319- function find(slice memory self , slice memory needle ) internal pure returns(
1324+ function find(slice memory self , slice memory needle ) internal pure returns (
13201325 slice memory
13211326 ) {
13221327 uint ptr = findPtr (self ._len , self ._ptr , needle ._len , needle ._ptr );
@@ -1333,7 +1338,7 @@ library strings {
13331338 * @param needle The text to search for.
13341339 * @return \`self\`.
13351340 */
1336- function rfind(slice memory self , slice memory needle ) internal pure returns(
1341+ function rfind(slice memory self , slice memory needle ) internal pure returns (
13371342 slice memory
13381343 ) {
13391344 uint ptr = rfindPtr (self ._len , self ._ptr , needle ._len , needle ._ptr );
@@ -1355,7 +1360,7 @@ library strings {
13551360 slice memory self ,
13561361 slice memory needle ,
13571362 slice memory token
1358- ) internal pure returns(slice memory ) {
1363+ ) internal pure returns (slice memory ) {
13591364 uint ptr = findPtr (self ._len , self ._ptr , needle ._len , needle ._ptr );
13601365 token ._ptr = self ._ptr ;
13611366 token ._len = ptr - self ._ptr ;
@@ -1378,7 +1383,7 @@ library strings {
13781383 * @param needle The text to search for in \`self\`.
13791384 * @return The part of \`self\` up to the first occurrence of \`delim\`.
13801385 */
1381- function split(slice memory self , slice memory needle ) internal pure returns(
1386+ function split(slice memory self , slice memory needle ) internal pure returns (
13821387 slice memory token
13831388 ) {
13841389 split (self , needle , token );
@@ -1398,7 +1403,7 @@ library strings {
13981403 slice memory self ,
13991404 slice memory needle ,
14001405 slice memory token
1401- ) internal pure returns(slice memory ) {
1406+ ) internal pure returns (slice memory ) {
14021407 uint ptr = rfindPtr (self ._len , self ._ptr , needle ._len , needle ._ptr );
14031408 token ._ptr = ptr ;
14041409 token ._len = self ._len - (ptr - self ._ptr );
@@ -1420,9 +1425,10 @@ library strings {
14201425 * @param needle The text to search for in \`self\`.
14211426 * @return The part of \`self\` after the last occurrence of \`delim\`.
14221427 */
1423- function rsplit(slice memory self , slice memory needle ) internal pure returns(
1424- slice memory token
1425- ) {
1428+ function rsplit(
1429+ slice memory self ,
1430+ slice memory needle
1431+ ) internal pure returns (slice memory token ) {
14261432 rsplit (self , needle , token );
14271433 }
14281434
@@ -1432,7 +1438,7 @@ library strings {
14321438 * @param needle The text to search for in \`self\`.
14331439 * @return The number of occurrences of \`needle\` found in \`self\`.
14341440 */
1435- function count(slice memory self , slice memory needle ) internal pure returns(
1441+ function count(slice memory self , slice memory needle ) internal pure returns (
14361442 uint cnt
14371443 ) {
14381444 uint ptr = findPtr (
@@ -1461,7 +1467,7 @@ library strings {
14611467 function contains(
14621468 slice memory self ,
14631469 slice memory needle
1464- ) internal pure returns(bool ) {
1470+ ) internal pure returns (bool ) {
14651471 return rfindPtr (
14661472 self ._len ,
14671473 self ._ptr ,
@@ -1477,7 +1483,7 @@ library strings {
14771483 * @param other The second slice to concatenate.
14781484 * @return The concatenation of the two strings.
14791485 */
1480- function concat(slice memory self , slice memory other ) internal pure returns(
1486+ function concat(slice memory self , slice memory other ) internal pure returns (
14811487 string memory
14821488 ) {
14831489 string memory ret = new string (self ._len + other ._len );
@@ -1498,7 +1504,7 @@ library strings {
14981504 * @return A newly allocated string containing all the slices in \`parts\`,
14991505 * joined with \`self\`.
15001506 */
1501- function join(slice memory self , slice [] memory parts ) internal pure returns(
1507+ function join(slice memory self , slice [] memory parts ) internal pure returns (
15021508 string memory
15031509 ) {
15041510 if (parts .length == 0 ) return " " ;
0 commit comments