mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-06-05 15:08:58 +00:00
sodium: Pass &Path instead of &PathBuf
This commit is contained in:
parent
f8adb42f7b
commit
5e89d345d8
2 changed files with 4 additions and 4 deletions
|
@ -28,7 +28,7 @@ use sodiumoxide::crypto::box_;
|
|||
|
||||
use std::error::Error;
|
||||
use std::fs::File;
|
||||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use clap::{App, Arg};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -40,7 +40,7 @@ struct Keys {
|
|||
}
|
||||
|
||||
impl Keys {
|
||||
fn from_file(file: &PathBuf) -> Result<Self, Box<dyn Error>> {
|
||||
fn from_file(file: &Path) -> Result<Self, Box<dyn Error>> {
|
||||
let f = File::open(&file)?;
|
||||
serde_json::from_reader(f).map_err(From::from)
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ use sodiumoxide::crypto::box_;
|
|||
|
||||
use std::error::Error;
|
||||
use std::fs::File;
|
||||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use clap::{App, Arg};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -40,7 +40,7 @@ struct Keys {
|
|||
}
|
||||
|
||||
impl Keys {
|
||||
fn from_file(file: &PathBuf) -> Result<Self, Box<dyn Error>> {
|
||||
fn from_file(file: &Path) -> Result<Self, Box<dyn Error>> {
|
||||
let f = File::open(&file)?;
|
||||
serde_json::from_reader(f).map_err(From::from)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue