Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8590dd6

Browse files
committed
move random string to util mod and remvoe secure file
1 parenta1b13a1 commit8590dd6

File tree

4 files changed

+13
-22
lines changed

4 files changed

+13
-22
lines changed

‎pgml-dashboard/src/templates/docs.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl NavLink {
2121
/// Create a new documentation link.
2222
pubfnnew(title:&str) ->NavLink{
2323
NavLink{
24-
id:crate::utils::secure::random_string(25),
24+
id:crate::utils::random_string(25),
2525
title: title.to_string(),
2626
href:"#".to_string(),
2727
children:vec![],

‎pgml-dashboard/src/utils/markdown.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ impl<'a> Tab<'a> {
586586
Tab{
587587
children:vec![],
588588
name,
589-
id:crate::utils::secure::random_string(10),
589+
id:crate::utils::random_string(10),
590590
active:false,
591591
}
592592
}

‎pgml-dashboard/src/utils/mod.rs‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
pubmod config;
22
pubmod datadog;
33
pubmod markdown;
4-
pubmod secure;
54
pubmod tabs;
65
pubmod time;
6+
7+
use rand::{distributions::Alphanumeric,Rng};
8+
9+
/// Generate a random string of any length.
10+
pubfnrandom_string(len:usize) ->String{
11+
rand::thread_rng()
12+
.sample_iter(&Alphanumeric)
13+
.take(len)
14+
.map(char::from)
15+
.collect()
16+
}

‎pgml-dashboard/src/utils/secure.rs‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp