termux-packages/packages/newsboat/rust-libnewsboat-src-fslock...

48 lines
2.0 KiB
Diff
Raw Normal View History

2022-05-05 03:32:57 +02:00
--- a/rust/libnewsboat/src/fslock.rs
+++ b/rust/libnewsboat/src/fslock.rs
2021-01-07 15:18:15 +01:00
@@ -1,5 +1,4 @@
use crate::logger::{self, Level};
-use gettextrs::gettext;
use std::fs::{self, File, OpenOptions};
use std::io::{Error, Read, Write};
use std::os::unix::fs::OpenOptionsExt;
@@ -54,10 +53,10 @@
Ok(file) => file,
Err(reason) => {
return Err(fmt!(
- &gettext("Failed to open lock file '%s': %s"),
+ "Failed to open lock file '%s': %s",
2021-01-07 15:18:15 +01:00
new_lock_path
.to_str()
- .unwrap_or(&gettext("<filename containing invalid UTF-8 codepoint>")),
+ .unwrap_or("<filename containing invalid UTF-8 codepoint>"),
reason.to_string()
))
}
2022-05-05 03:32:57 +02:00
@@ -74,10 +73,10 @@
if let Err(reason) = file.set_len(0).and_then(|_| file.write_all(pid.as_bytes())) {
2021-01-07 15:18:15 +01:00
log!(Level::Debug, "FsLock: Failed to write PID");
return Err(fmt!(
- &gettext("Failed to write PID to lock file '%s': %s"),
+ "Failed to write PID to lock file '%s': %s",
2021-01-07 15:18:15 +01:00
new_lock_path
.to_str()
- .unwrap_or(&gettext("<filename containing invalid UTF-8 codepoint>")),
+ .unwrap_or("<filename containing invalid UTF-8 codepoint>"),
reason.to_string()
));
}
2022-05-05 03:32:57 +02:00
@@ -106,10 +105,10 @@
2021-01-07 15:18:15 +01:00
pid
);
Err(fmt!(
2022-05-05 03:32:57 +02:00
- &gettext("Failed to lock '%s', already locked by process with PID %s"),
+ "Failed to lock '%s', already locked by process with PID %s",
2021-01-07 15:18:15 +01:00
new_lock_path
.to_str()
- .unwrap_or(&gettext("<filename containing invalid UTF-8 codepoint>")),
+ .unwrap_or("<filename containing invalid UTF-8 codepoint>"),
2022-05-05 03:32:57 +02:00
&(*pid).to_string()
2021-01-07 15:18:15 +01:00
))
2022-05-05 03:32:57 +02:00
}