Browse Source

Space things out for better readability

Vecna 1 year ago
parent
commit
3a6423d2ba
4 changed files with 18 additions and 0 deletions
  1. 3 0
      src/extra_info.rs
  2. 4 0
      src/lib.rs
  3. 4 0
      src/negative_report.rs
  4. 7 0
      src/positive_report.rs

+ 3 - 0
src/extra_info.rs

@@ -24,13 +24,16 @@ pub const DIRECTORY: &str = "extra_infos";
 pub struct ExtraInfo {
     /// Bridge nickname, probably unused
     pub nickname: String,
+
     /// Bridge fingerprint, a SHA-1 hash of the bridge ID
     pub fingerprint: [u8; 20],
+
     /// Date (in UTC) that this document covered (bridge-stats-end if
     /// available) or that the document was published (published), stored
     /// as a Julian date because we don't need to know more precisely than
     /// the day.
     pub date: u32,
+
     /// Map of country codes and how many users (rounded up to a multiple of
     /// 8) have connected to that bridge during the day.
     /// Uses BTreeMap instead of HashMap so ExtraInfo can implement Hash.

+ 4 - 0
src/lib.rs

@@ -63,12 +63,16 @@ pub fn get_date() -> u32 {
 pub struct BridgeInfo {
     /// hashed fingerprint (SHA-1 hash of 20-byte bridge ID)
     pub fingerprint: [u8; 20],
+
     /// nickname of bridge (probably not necessary)
     pub nickname: String,
+
     /// first Julian date we started collecting data on this bridge
     pub first_seen: u32,
+
     /// flag indicating whether the bridge is believed to be blocked
     pub is_blocked: bool,
+
     /// map of dates to data for that day
     pub info_by_day: HashMap<u32, DailyBridgeInfo>,
 }

+ 4 - 0
src/negative_report.rs

@@ -19,10 +19,13 @@ pub enum NegativeReportError {
 pub struct NegativeReport {
     /// hashed fingerprint (SHA-1 hash of 20-byte bridge ID)
     pub fingerprint: [u8; 20],
+
     /// some way to prove knowledge of bridge
     bridge_pok: ProofOfBridgeKnowledge,
+
     /// user's country code
     pub country: String,
+
     /// today's Julian date
     pub date: u32,
 }
@@ -140,6 +143,7 @@ impl SerializableNegativeReport {
 pub enum ProofOfBridgeKnowledge {
     /// Hash of bridge line as proof of knowledge of bridge line
     HashOfBridgeLine(HashOfBridgeLine),
+
     /// Hash of bucket ID for Lox user
     HashOfBucket(HashOfBucket),
 }

+ 7 - 0
src/positive_report.rs

@@ -24,12 +24,16 @@ pub enum PositiveReportError {
 pub struct PositiveReport {
     /// hashed fingerprint (SHA-1 hash of 20-byte bridge ID)
     pub fingerprint: [u8; 20],
+
     /// token from the bridge indicating it was reached
     bridge_token: Option<BridgeToken>,
+
     // proof of Lox cred with level >= 3 and this bridge
     lox_proof: lox_pr::Request,
+
     /// user's country code, may be an empty string
     pub country: String,
+
     /// today's Julian date
     pub date: u32,
 }
@@ -189,8 +193,10 @@ impl SerializablePositiveReport {
 pub struct UnsignedBridgeToken {
     /// hashed fingerprint (SHA-1 hash of 20-byte bridge ID)
     pub fingerprint: [u8; 20],
+
     /// client's country code
     pub country: String,
+
     /// today's Julian date
     pub date: u32,
 }
@@ -259,6 +265,7 @@ impl SerializableUnsignedBridgeToken {
 pub struct BridgeToken {
     /// the unsigned version of this token
     pub unsigned_bridge_token: UnsignedBridgeToken,
+
     /// signature from bridge's ed25519 key
     sig: Signature,
 }