Fix The PNG > BRUH won't work#7
Conversation
|
Still not merged lmfao |
|
bruh |
Pun intended? |
yep. lmao |
Cursing is bad... just fyi |
lmao what |
|
@face-hh when merge 🗿 |
lm BAD WORD HERE o This is trivial. |
WalkthroughAn explicit import of Changes
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Clippy (1.86.0)warning: failed to write cache, path: /usr/local/registry/index/index.crates.io-1949cf8c6b5b557f/.cache/ba/se/base64, error: Permission denied (os error 13) Caused by: ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
main.rs (1)
61-67: Refactor file creation to be more efficient and consistent.The current approach creates a file handle and immediately discards it, then opens the same file again with
OpenOptions. This is inefficient and could cause issues on some systems.Solution 1 (Recommended): Use the created file handle directly
- File::create(path_to_bruh)?; - - let mut file = OpenOptions::new() - .write(true) - .create(true) - .open(path_to_bruh) - .expect("Couldnt write"); + let mut file = File::create(&path_to_bruh)?;Solution 2: Add truncate to OpenOptions
- File::create(path_to_bruh)?; - let mut file = OpenOptions::new() .write(true) .create(true) + .truncate(true) - .open(path_to_bruh) - .expect("Couldnt write"); + .open(&path_to_bruh)?;Note: Solution 1 is preferred as it's more concise and maintains consistent error handling with the
?operator.
🧹 Nitpick comments (1)
main.rs (1)
60-60: Improve path manipulation robustness.Using simple string replacement for file extensions can be unreliable if the filename contains ".png" in unexpected places.
Consider using
Pathmethods for more robust extension handling:- let path_to_bruh = path_str.replace(".png", ".bruh"); + let path_to_bruh = path.with_extension("bruh");This would require updating the subsequent file operations to work with
PathBufinstead ofString, which is more type-safe.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
main.rs(3 hunks)
🔇 Additional comments (1)
main.rs (1)
17-17: Import is correctly used.The import is used on line 61, so it's necessary and appropriate.
|
@face-hh cmon man |
brushhhhhh |
|
ping to bruh
|
i only fixed the issue:
⚠ The PNG > BRUH won't work unless you have the same file (i.e. image.png) but with the .bruh extension (i.e. image.bruh). What do you have to do? Create an empty file called image.bruh.
||(i haven't tested it out yet because my windows laptop has issues with rust somehow)||
Summary by CodeRabbit