Updated drag drop paths to be PathBuf instead of String.

This commit is contained in:
Brian Carlsen 2024-07-23 16:31:07 +02:00
parent 4698574b7d
commit aa3a64af11
No known key found for this signature in database
GPG key ID: B14D281A79B2DDB7

View file

@ -14,7 +14,7 @@ use futures::{
Future, FutureExt, Stream, StreamExt, Future, FutureExt, Stream, StreamExt,
}; };
use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde::{de::DeserializeOwned, Deserialize, Serialize};
use std::{any::Any, collections::HashMap}; use std::{any::Any, collections::HashMap, path::PathBuf};
use wasm_bindgen::{prelude::Closure, JsValue}; use wasm_bindgen::{prelude::Closure, JsValue};
/// Events that are emitted right here instead of by the created window. /// Events that are emitted right here instead of by the created window.
@ -105,12 +105,12 @@ pub enum DragDropEvent {
#[derive(Deserialize, Debug)] #[derive(Deserialize, Debug)]
pub struct DragDropPayload { pub struct DragDropPayload {
paths: Vec<String>, paths: Vec<PathBuf>,
position: dpi::PhysicalPosition, position: dpi::PhysicalPosition,
} }
impl DragDropPayload { impl DragDropPayload {
pub fn paths(&self) -> &Vec<String> { pub fn paths(&self) -> &Vec<PathBuf> {
&self.paths &self.paths
} }