diff options
Diffstat (limited to 'src/database/file/mod.rs')
-rw-r--r-- | src/database/file/mod.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/database/file/mod.rs b/src/database/file/mod.rs index af07c0c..b3856a6 100644 --- a/src/database/file/mod.rs +++ b/src/database/file/mod.rs @@ -1,5 +1,5 @@ //#![warn(clippy::unwrap_used)] -use crate::database::{filter_post, ErrorKind, Result, Storage, StorageError}; +use crate::database::{filter_post, ErrorKind, Result, Storage, StorageError, Settings}; use std::fs::{File, OpenOptions}; use std::io::{ErrorKind as IOErrorKind, Seek, SeekFrom, Read, Write}; use std::time::Duration; @@ -387,6 +387,10 @@ impl Storage for FileStorage { { symlink_result = std::os::windows::fs::symlink_file(relative, link); } + #[cfg(all(not(unix), not(windows)))] + { + compile_error!("Don't know how to create symlinks on non-unix non-windows platform"); + } if let Err(e) = symlink_result { Err(e.into()) } else { @@ -596,7 +600,7 @@ impl Storage for FileStorage { } } - async fn get_setting(&self, setting: &'_ str, user: &'_ str) -> Result<String> { + async fn get_setting(&self, setting: Settings, user: &'_ str) -> Result<String> { log::debug!("User for getting settings: {}", user); let url = warp::http::Uri::try_from(user).expect("Couldn't parse a URL"); let mut path = relative_path::RelativePathBuf::new(); @@ -626,7 +630,7 @@ impl Storage for FileStorage { )).await?.unwrap() } - async fn set_setting(&self, setting: &'_ str, user: &'_ str, value: &'_ str) -> Result<()> { + async fn set_setting(&self, setting: Settings, user: &'_ str, value: &'_ str) -> Result<()> { let url = warp::http::Uri::try_from(user).expect("Couldn't parse a URL"); let mut path = relative_path::RelativePathBuf::new(); path.push(url.authority().unwrap().to_string()); |