Simplify gen_name function
Signed-off-by: Tomasz Boguszewski <tomekboguszewski1@gmail.com>
This commit is contained in:
parent
582e025145
commit
6372c96722
@ -4,10 +4,8 @@ use hbb_common::ResultType;
|
||||
use license::*;
|
||||
|
||||
fn gen_name(lic: &License) -> ResultType<String> {
|
||||
let tmp = serde_json::to_vec::<License>(lic)?;
|
||||
let tmp = URL_SAFE_NO_PAD.encode(&tmp);
|
||||
let tmp: String = tmp.chars().rev().collect();
|
||||
Ok(tmp)
|
||||
let tmp = URL_SAFE_NO_PAD.encode(&serde_json::to_vec(lic)?);
|
||||
Ok(tmp.chars().rev().collect())
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user