You take the `other`, do a `to_string()` on it, which creates a String representation. Then you pass a reference to that String, and, in the case it doesn't contain `time out` or `timeout` or `refused`, the reference gets turned AGAIN into a String (i.e. new allocation), truncated to 48, and then returned.
There is no check whether that the character at the 48th byte is a character boundary.
Add to that the fact that this is a Rust project with the oldest commit created yesterday and it is using the 2021 edition.
It's gotten to the point that the moment I see "Rust" and "TUI" together, I immediately assume it's vibe coded. The combination just seems to be vibe coders' favorite, for some reason.
Quite mixed on this one given that the author has experience with Rust before coding agents and this is just his toy project.
There is going to be a time where these vibe coded projects have silent bugs, vulnerabilities or unnecessary performance issues and the AI coding agent just lies to the user that it has none.
The AI agent will be the one to introduce new issues in the codebase regardless of "tests". The new issue is now the non-technical human vibe-coding is none the wiser.
We have already seen this in Codex itself. Imagine this propagated in many other code-bases.
Having created and debugged human-written code with silent bugs, vulnerabilities, or unnecessary performance issues since my first day on the job, and pointing you to myriad companies with bugs and vulnerabilities that existed pre-AI, all I can say is "plus ça change, plus c'est la même chose."
The very first thing written about this tool is the programming language it's written in.
Like, when I'm querying a bunch of DNS servers, it is crucial for me to know which compilable language it was written in. Like, the most important thing.
https://github.com/514-labs/dnsglobe/blob/c29802162636832e88...
You take the `other`, do a `to_string()` on it, which creates a String representation. Then you pass a reference to that String, and, in the case it doesn't contain `time out` or `timeout` or `refused`, the reference gets turned AGAIN into a String (i.e. new allocation), truncated to 48, and then returned.
There is no check whether that the character at the 48th byte is a character boundary.
Add to that the fact that this is a Rust project with the oldest commit created yesterday and it is using the 2021 edition.
Be better.