Gedit freezes with main.rs

every time I use Gedit to save or save changes to a main.rs file (Rust obviously) it freezes and does not close, as if it were in an infinite loop

it’s happening to me again with the files with extension .txt