Skip to content

Commit 51d5f9d

Browse files
committed
changed String to PathBuf
1 parent 401f477 commit 51d5f9d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/main.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,20 +143,19 @@ fn shell_exec(vm: &mut VirtualMachine, source: &str, scope: PyObjectRef) -> bool
143143
}
144144

145145
#[cfg(target_family = "windows")]
146-
fn get_history_path() -> String {
147-
//
148-
String::from(".repl_history.txt")
146+
fn get_history_path() -> PathBuf {
147+
//Path buffer
148+
PathBuf::from(".repl_history.txt")
149149
}
150150

151151
#[cfg(target_family = "unix")]
152-
fn get_history_path() -> String {
152+
fn get_history_path() -> PathBuf {
153153
//work around for windows dependent builds. The xdg crate is unix specific
154154
//so access to the BaseDirectories struct breaks builds on python.
155155
extern crate xdg;
156156

157157
let xdg_dirs = xdg::BaseDirectories::with_prefix("rustpython").unwrap();
158-
let repl_history_path = xdg_dirs.place_cache_file("repl_history.txt").unwrap();
159-
repl_history_path.to_str().unwrap()
158+
xdg_dirs.place_cache_file("repl_history.txt").unwrap()
160159
}
161160

162161
fn run_shell(vm: &mut VirtualMachine) -> PyResult {

0 commit comments

Comments
 (0)