Skip to content

Commit 90756fe

Browse files
committed
Use path instead of string for document folder type
1 parent 4ed5fba commit 90756fe

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/core/scriptslog.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,12 @@ fn scriptslog_file() -> Result<File, String> {
6060
let mut docs = None;
6161
if let Some(ud) = UserDirs::new() {
6262
if let Some(path) = ud.document_dir() {
63-
if let Some(s) = path.to_str() {
64-
docs = Some(s.to_owned());
65-
}
63+
docs = Some(path.to_owned());
6664
}
6765
}
6866

6967
if let Some(docs) = docs {
70-
let scriptslog_path = Path::new(&docs).join(Path::new("The Witcher 3").join(constants::SCRIPTSLOG_FILE_NAME));
68+
let scriptslog_path = docs.join(Path::new("The Witcher 3").join(constants::SCRIPTSLOG_FILE_NAME));
7169

7270
let file = OpenOptions::new()
7371
.read(true)

0 commit comments

Comments
 (0)