]> git.scottworley.com Git - tattlekey/commitdiff
server: Log file name constant
authorScott Worley <scottworley@scottworley.com>
Tue, 10 Oct 2023 23:45:39 +0000 (16:45 -0700)
committerScott Worley <scottworley@scottworley.com>
Wed, 11 Oct 2023 01:50:37 +0000 (18:50 -0700)
server/src/main.rs

index a186abd58ec1b0e8045b0e29881fbcd7ecd76229..62ef41ef40a71d5fd436739ef2e15f1b83c2dd01 100644 (file)
@@ -20,6 +20,7 @@ use std::net::UdpSocket;
 use std::time::{Duration, SystemTime};
 
 const MESSAGE_SIZE: usize = 12;
+const LOGFILENAME: &str = "log.csv";
 
 #[derive(Eq, Debug, Hash, PartialEq, Serialize)]
 struct MessageKey {
@@ -83,7 +84,7 @@ fn main() {
     let logfile = std::fs::OpenOptions::new()
         .create(true)
         .append(true)
-        .open("log.csv")
+        .open(LOGFILENAME)
         .expect("Coudln't open log file");
     let mut log = csv::Writer::from_writer(logfile);
     let mut presses = HashMap::<MessageKey, Range>::new();