summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/schema.rs11
1 files 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 {
175 } 175 }
176} 176}
177 177
178/// Simply a Student 178/// A Student
179///
180/// * [`user_id`]: Can only be one of the repopulated
181/// * [`public_key`]: A PEM format public key "---- BEGIN" and all
182/// * [`balance`]: User's current Gradecoin amount
179#[derive(Serialize, Deserialize, Debug, PartialEq)] 183#[derive(Serialize, Deserialize, Debug, PartialEq)]
180pub struct User { 184pub struct User {
181 pub user_id: MetuId, 185 pub user_id: MetuId,
@@ -253,10 +257,7 @@ impl fmt::Display for MetuId {
253impl MetuId { 257impl MetuId {
254 pub fn new(id: String, pwd: String) -> Option<Self> { 258 pub fn new(id: String, pwd: String) -> Option<Self> {
255 if OUR_STUDENTS.contains(&(&*id, &*pwd)) { 259 if OUR_STUDENTS.contains(&(&*id, &*pwd)) {
256 Some(MetuId { 260 Some(MetuId { id, passwd: pwd })
257 id,
258 passwd: pwd,
259 })
260 } else { 261 } else {
261 None 262 None
262 } 263 }