Skip to content

Commit 1f307ad

Browse files
committed
Include mainfile
1 parent d6fc250 commit 1f307ad

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/main.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
use geo::algorithm::haversine_distance::HaversineDistance;
22
use parking_lot::RwLock;
33
use std::io::Write;
4-
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4};
54
use std::sync::Arc;
65
use std::thread;
76
use std::time::Duration;
8-
use tiny_http::{Request, Response};
7+
use tiny_http::Request;
98
use url::Url;
109

1110
use crate::base::music::SongInfo;
@@ -14,6 +13,7 @@ mod api;
1413
mod base;
1514

1615
static LINE_MAX: usize = 60;
16+
static MAIN_BODY: &str = include_str!("main.txt");
1717

1818
#[derive(Debug)]
1919
struct State {
@@ -155,8 +155,7 @@ fn root(request: Request, state: Arc<RwLock<State>>) {
155155
time, si.track, si.artist, si.month_artist
156156
);
157157

158-
let body = std::fs::read_to_string("src/main.txt")
159-
.unwrap()
158+
let body = MAIN_BODY
160159
.replace("🎵", &song_string)
161160
.replace("📌", &location_string);
162161

0 commit comments

Comments
 (0)