-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bias generated char
s (#99)
#116
Conversation
That's how generated strings typically looks now: O�ò»¹��[.? }'셥-�91(]ª!ñ�·�� #* "9ô�£´�:{乸0%㯓9똁⁔Rz릉¤tó£±�? (]>� <nf)*ᖯ'��ñ��°6>¦ó¤�¡匈�#$'`맽ô���cHX)�[r莅3*A ð¹�§7] G_媣<ꉟต8~^i7䱄釱fh)+��{G�0� ﵽ❔K/5‴9[꤅X1J[M&4[¥" ⇉Ɩ©�42폨ĒUñ�¸�5.`'O§)�-���*ñ·�¼r '@/@�骲6!ñ�§��,&E e?!�fó � 󶱬V�_ (]>el󯣿o+狪*="⁅ ñ���肖<{ó¿¿½\+巤 {T��*ô�¿½⁆?ó¿¿½ ꡯ칵쫨C}1<ʼn��*���..#ñ��º& J:,j=‹3“褙`}j¬ñ���+‐󾬲¦bO©S�ñ¡��~~�.�ª =㍃�&f�E&Q@ð¾�±R�笹 ⁁�D 6')�m9m�)�sqT�3H㹵035蹈\>^鯅ñ��»ó���ó¨£��‰쩻8 ⁋0�N\WGô�¡�¥�®��5UWñª���1钟[!�X��+<󿬹難"4�ó�®³ᔵ"ó¬�®!G 揟’O�1'ñ�¿��+髾@$Zvó�¹�䵃�;ð»�¸�h뢚ស9Yó¿¿¾_L蛇�AjpⰚ�㤩 ©揪)ò�®�-d�A){¥攝剟>~ó���=" «ó¿¿½1賬‟z⁉�VOô�¿¾�2I!mô�´¿N4;,ñ�¾»i>-\B��)裉᷈�f륯 +ाX~9[u 樴m‿ñ°��!=�=�C[ ط57_£=‴�`5�_�4}⁃‥�у灼 ¥1:�>ð�©» <$)>@, -"♄f<��ð¶¾�
match mode { | ||
0...49 => { | ||
// ASCII + some control characters | ||
char::from_u32(g.gen_range(0, 0xB0)).expect("I except all characters with codepoints 0 to 255 to be valid") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use the cast from u8 to char to skip both from_u32 and the expect.
Bias generated `char`s (#99)
Looks great, thank you! |
@vi Just wanted to thank you again! This particular patched ended up catching a potential bug in the regex crate! |
|
I think for integer types the answer is definitely yes. See #119. I'm not sure whether I want to add a bunch of array impls to this crate (especially up to |
For arrays it can be done after language change supporting integer templating and so on. Until then there can be just a dangling opened issue about it. |
That's how generated strings typically look now:
O���[.?
}'셥-�91(]ª!ñ�·�� #* "9ô�£´�:{乸0%㯓9똁⁔Rz릉¤tó£±�? (]>�
<nf)_ᖯ'��ñ��°6>¦ó¤�¡匈�#$'`맽ô���cHX)�[r莅3_A ð¹�§7]
ﵽ❔K/5‴9[꤅X1J[M&4[¥"
⇉Ɩ©�42폨ĒUñ�¸�5.`'O§)�-���_ñ·�¼r
'@/@�骲6!ñ�§��,&E
e?!�fó � 󶱬V�_ (]>el󯣿o+狪_="⁅
ñ���肖<{ó¿¿½+巤
{T��_ô�¿½⁆?ó¿¿½ ꡯ칵쫨C}1<ʼn��_���..#ñ��º& J:,j=‹3“褙`}j¬ñ���+‐󾬲¦bO©S�ñ¡��~~�.�ª
=㍃�&f�E&Q@ð¾�±R�笹
⁁�D
6')�m9m�)�sqT�3H㹵035蹈>^鯅ñ��»ó���ó¨£��‰쩻8 ⁋0�N\WGô�¡�¥�®��5UWñª���1钟[!�X��+<󿬹難"4�ó�®³ᔵ"ó¬�®!G
揟’O�1'ñ�¿��+髾@$Zvó�¹�䵃�;ð»�¸�h뢚ស9Yó¿¿¾_L蛇�AjpⰚ�㤩
©揪)ò�®�-d�A){¥攝剟>~ó���="
«ó¿¿½1賬‟z⁉�VOô�¿¾�2I!mô�´¿N4;,ñ�¾»i>-\B��)裉᷈�f륯 +ाX~9[u 樴m‿ñ°��!=�=�C[ ط57_£=‴�`5�_�4}⁃‥�у灼 ¥1:�>ð�©»
<$)>@, -"♄f<��ð¶¾�