From ba585309ec9ba6102038cd16c3fff107dfc1f56c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 29 Jul 2020 19:49:10 +0200 Subject: Replace rand with oorandom --- crates/ra_ide/src/syntax_highlighting/html.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_ide/src/syntax_highlighting') diff --git a/crates/ra_ide/src/syntax_highlighting/html.rs b/crates/ra_ide/src/syntax_highlighting/html.rs index 0be55bca9..a5e7d2867 100644 --- a/crates/ra_ide/src/syntax_highlighting/html.rs +++ b/crates/ra_ide/src/syntax_highlighting/html.rs @@ -1,5 +1,6 @@ //! Renders a bit of code as HTML. +use oorandom::Rand32; use ra_db::SourceDatabase; use ra_syntax::{AstNode, TextRange, TextSize}; @@ -9,13 +10,12 @@ pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: boo let parse = db.parse(file_id); fn rainbowify(seed: u64) -> String { - use rand::prelude::*; - let mut rng = SmallRng::seed_from_u64(seed); + let mut rng = Rand32::new(seed); format!( "hsl({h},{s}%,{l}%)", - h = rng.gen_range::(0, 361), - s = rng.gen_range::(42, 99), - l = rng.gen_range::(40, 91), + h = rng.rand_range(0..361), + s = rng.rand_range(42..99), + l = rng.rand_range(40..91), ) } -- cgit v1.2.3