diff options
| author | Roee Shapira <35409124+5c077m4n@users.noreply.github.com> | 2020-11-28 21:02:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-28 20:02:05 +0100 |
| commit | 9ad7b8a35ea34297905ec479dbf87a35802cd8b1 (patch) | |
| tree | 6c61f8e74b72b9c8b484f39fe2173d927227bf26 /src/utils | |
| parent | feat(tiles): initial WASM integration (diff) | |
| download | sl0ppij-9ad7b8a35ea34297905ec479dbf87a35802cd8b1.tar.gz sl0ppij-9ad7b8a35ea34297905ec479dbf87a35802cd8b1.tar.xz sl0ppij-9ad7b8a35ea34297905ec479dbf87a35802cd8b1.zip | |
chore(infra): added clippy check. (#65)
* Added clippy check.
* Changed step name.
* Used the suggested ci config.
* Some more clippy fixes.
* Some more clippy fixes.
* More clippy fixes.
* Removed allow annotations.
* Minor lint edit.
* More clippy fixes.
* Ran cargo fmt.
* More clippy fixes.
* More clippy fixes.
* More clippy fixes.
* More clippy fixes.
* More clippy fixes.
* More clippy fixes.
* Code review edits.
* Code review edits.
* Code review edits.
* CI update.
* CI update.
* CI update.
* Added clippy warn so wip won't fail ci.
* Cargo fmt.
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/logging.rs | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/utils/logging.rs b/src/utils/logging.rs index 4bd53743..1af1cb06 100644 --- a/src/utils/logging.rs +++ b/src/utils/logging.rs @@ -30,33 +30,33 @@ pub fn debug_log_to_file(message: String) -> io::Result<()> { .create(true) .open(MOSAIC_TMP_LOG_FILE)?; file.write_all(message.as_bytes())?; - file.write_all("\n".as_bytes())?; - - Ok(()) + file.write_all(b"\n") } pub fn debug_log_to_file_pid_0(message: String, pid: RawFd) -> io::Result<()> { if pid == 0 { - debug_log_to_file(message)?; + debug_log_to_file(message) + } else { + Ok(()) } - - Ok(()) } +#[allow(dead_code)] pub fn delete_log_file() -> io::Result<()> { if fs::metadata(MOSAIC_TMP_LOG_FILE).is_ok() { - fs::remove_file(MOSAIC_TMP_LOG_FILE)?; + fs::remove_file(MOSAIC_TMP_LOG_FILE) + } else { + Ok(()) } - - Ok(()) } +#[allow(dead_code)] pub fn delete_log_dir() -> io::Result<()> { if fs::metadata(MOSAIC_TMP_LOG_DIR).is_ok() { - fs::remove_dir_all(MOSAIC_TMP_LOG_DIR)?; + fs::remove_dir_all(MOSAIC_TMP_LOG_DIR) + } else { + Ok(()) } - - Ok(()) } pub fn debug_to_file(message: u8, pid: RawFd) -> io::Result<()> { @@ -68,7 +68,5 @@ pub fn debug_to_file(message: u8, pid: RawFd) -> io::Result<()> { .append(true) .create(true) .open(path)?; - file.write_all(&[message])?; - - Ok(()) + file.write_all(&[message]) } |
