From 7d8b9272f885c2a240867f45e7abccc98ebf18f7 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 15 Apr 2021 23:25:21 +0300 Subject: Add Doc for User --- src/schema.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/schema.rs b/src/schema.rs index dca0eef..79fee2d 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -175,7 +175,11 @@ impl Default for Block { } } -/// Simply a Student +/// A Student +/// +/// * [`user_id`]: Can only be one of the repopulated +/// * [`public_key`]: A PEM format public key "---- BEGIN" and all +/// * [`balance`]: User's current Gradecoin amount #[derive(Serialize, Deserialize, Debug, PartialEq)] pub struct User { pub user_id: MetuId, @@ -253,10 +257,7 @@ impl fmt::Display for MetuId { impl MetuId { pub fn new(id: String, pwd: String) -> Option { if OUR_STUDENTS.contains(&(&*id, &*pwd)) { - Some(MetuId { - id, - passwd: pwd, - }) + Some(MetuId { id, passwd: pwd }) } else { None } -- cgit v1.2.3-70-g09d2