clone outside

This commit is contained in:
yggverse 2025-08-03 14:44:47 +03:00
parent 644b09c04b
commit 157f13c984
2 changed files with 3 additions and 3 deletions

View file

@ -41,7 +41,7 @@ async fn main() -> Result<()> {
)?; )?;
let trackers = Trackers::init(&config.tracker)?; let trackers = Trackers::init(&config.tracker)?;
let session = librqbit::Session::new_with_opts( let session = librqbit::Session::new_with_opts(
preload.root(), preload.root().clone(),
SessionOptions { SessionOptions {
bind_device_name: config.bind, bind_device_name: config.bind,
listen: None, listen: None,

View file

@ -37,8 +37,8 @@ impl Preload {
Ok(p) Ok(p)
} }
pub fn root(&self) -> PathBuf { pub fn root(&self) -> &PathBuf {
self.root.clone() &self.root
} }
pub fn bytes(&self, relative: &PathBuf) -> Result<Vec<u8>> { pub fn bytes(&self, relative: &PathBuf) -> Result<Vec<u8>> {