Skip to content

Commit be8e019

Browse files
author
Devdutt Shenoi
authored
feat: use current_dir instead of /var/lib (#260)
* refactor: clean `DEFAULT_CONFIG` * fix: use `current_dir` for persistence
1 parent a501350 commit be8e019

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

uplink/src/base/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::env::current_dir;
12
use std::path::PathBuf;
23
use std::time::{SystemTime, UNIX_EPOCH};
34
use std::{collections::HashMap, fmt::Debug};
@@ -34,7 +35,9 @@ fn default_file_size() -> usize {
3435
}
3536

3637
fn default_persistence_path() -> PathBuf {
37-
PathBuf::from("/var/lib/uplink")
38+
let mut path = current_dir().expect("Couldn't figure out current directory");
39+
path.push(".persistence");
40+
path
3841
}
3942

4043
pub fn clock() -> u128 {

uplink/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ pub mod config {
104104
keep_alive = 30
105105
network_timeout = 30
106106
107-
# Create empty streams map
108-
[streams]
109-
110107
# Downloader config
111108
[downloader]
112109
actions = []

0 commit comments

Comments
 (0)