Skip to content

Commit

Permalink
Convert PathBufRef to PathRef
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
  • Loading branch information
gwbres committed Aug 21, 2024
1 parent 384b726 commit ffa21a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion anise/src/naif/kpl/tpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ fn test_anise_conversion() {
let path = "../target/gm_pck_08.anise";

// Test saving
dataset.save_as(&PathBuf::from(path), true).unwrap();
dataset.save_as(&Path::from(path), true).unwrap();

// Test reloading
let bytes = file2heap!(path).unwrap();
Expand Down
3 changes: 1 addition & 2 deletions anise/src/structure/dataset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ macro_rules! io_imports {
use std::fs::File;
use std::io::{Error as IOError, ErrorKind as IOErrorKind, Write};
use std::path::Path;
use std::path::PathBuf;
};
}

Expand Down Expand Up @@ -378,7 +377,7 @@ impl<T: DataSetT, const ENTRIES: usize> DataSet<T, ENTRIES> {

/// Saves this dataset to the provided file
/// If overwrite is set to false, and the filename already exists, this function will return an error.
pub fn save_as(&self, filename: &PathBuf, overwrite: bool) -> Result<(), DataSetError> {
pub fn save_as(&self, filename: &Path, overwrite: bool) -> Result<(), DataSetError> {
use log::{info, warn};

if Path::new(&filename).exists() {
Expand Down

0 comments on commit ffa21a2

Please sign in to comment.