robiot / rustcat

Rustcat(rcat) - The modern Port listener and Reverse shell
https://git.io/rustcat
GNU General Public License v3.0
675 stars 61 forks source link

Modifications following idiomatic Rust patterns #30

Closed ghost closed 2 years ago

ghost commented 2 years ago

On noticing repeated code patterns in the TCP and UDP handling code in listeners.rs, I added a decorator which takes a closure in (to perform the respective protocol operations). Some other logic like the (host, port) check has been rewritten with slice pattern matching, if lets and matches.

robiot commented 2 years ago

Looks great to me, thank you! I just fixed a small issue where the history didn't work because it created a new editor each time in the loop. If you find any more issues after the merge, you can make a new pull request, or an issue and I'll fix it.

Btw, congrats on your first pr :).

ghost commented 2 years ago

Glad you fixed the issue. Thank you so much!