-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
NikVolf
commented
May 31, 2016
- stop guard
- random strings
// You should have received a copy of the GNU General Public License | ||
// along with Parity. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
//! Random path |
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.
leftover doc comment
} | ||
|
||
pub fn random_str(len: usize) -> String { | ||
(0..len).map(|_| ((random::<f32>() * 26.0) as u8 + 97) as char).collect() |
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.
random_alpha_lowercase might be a more descriptive name
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.
better keep it small until we have more than just one
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.
random::<f32>
? really? what about plain old random::<u8>() % 26
?
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.
It is not strictly uniform, not that it matters in this function
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.
it is not used anywhere except tests and it's been there for ages
it is not about this pr