You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/tauri/src/api/path.rs
+16-8Lines changed: 16 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ use std::{
7
7
path::{Path,PathBuf},
8
8
};
9
9
10
-
usecrate::Config;
10
+
usecrate::{Config,PackageInfo};
11
11
12
12
use serde_repr::{Deserialize_repr,Serialize_repr};
13
13
@@ -65,14 +65,22 @@ pub enum BaseDirectory {
65
65
///
66
66
/// # Example
67
67
/// ```
68
-
/// use tauri::api::path::{resolve_path, BaseDirectory};
69
-
/// // we use the default config, but in an actual app you should get the Config created from tauri.conf.json
70
-
/// let path = resolve_path(&Default::default(), "path/to/something", Some(BaseDirectory::Config))
71
-
/// .expect("failed to resolve path");
68
+
/// use tauri::api::{path::{resolve_path, BaseDirectory}, PackageInfo};
69
+
/// // we use the default config and a mock PackageInfo, but in an actual app you should get the Config created from tauri.conf.json and the app's PackageInfo instance
70
+
/// let path = resolve_path(
71
+
/// &Default::default(),
72
+
/// &PackageInfo {
73
+
/// name: "app".into(),
74
+
/// version: "1.0.0".into(),
75
+
/// },
76
+
/// "path/to/something",
77
+
/// Some(BaseDirectory::Config)
78
+
/// ).expect("failed to resolve path");
72
79
/// // path is equal to "/home/${whoami}/.config/path/to/something" on Linux
0 commit comments