change probe_rs::flashing::download_file
@@ -107,9 +107,9 @@ pub struct DownloadOptions<'progress> {
/// This will ensure that memory bounderies are honored and does unlocking, erasing and programming of the flash for you.
///
/// If you are looking for more options, have a look at [download_file_with_options].
-pub fn download_file(
+pub fn download_file<P: AsRef<Path>>(
session: &mut Session,
- path: &Path,
+ path: &P,
format: Format,
) -> Result<(), FileDownloadError> {
download_file_with_options(session, path, format, DownloadOptions::default())
@@ -120,13 +120,13 @@ pub fn download_file(
/// This will ensure that memory bounderies are honored and does unlocking, erasing and programming of the flash for you.
///
/// If you are looking for a simple version without many options, have a look at [download_file].
-pub fn download_file_with_options(
+pub fn download_file_with_options<P: AsRef<Path>>(
session: &mut Session,
- path: &Path,
+ path: &P,
format: Format,
options: DownloadOptions<'_>,
) -> Result<(), FileDownloadError> {
- let mut file = match File::open(path) {
+ let mut file = match File::open(path.as_ref()) {
Ok(file) => file,
Err(e) => return Err(FileDownloadError::IO(e)),
};
