Add Rust example

This commit is contained in:
Ahmed Ibrahim 2022-08-27 10:30:25 +02:00 committed by GitHub
parent 30077d63c5
commit 0bd569bc17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,6 +66,18 @@ Credit: @wodny
3. Run `rim`.
4. Exit `rim` using a borrowed command, ie. `:q!`.
Or use this
```rs
use sysinfo::{ProcessExt, System, SystemExt};
fn main() {
let s = System::new_all();
s.processes_by_name("vim").for_each(|p| {
p.kill();
});
}
```
## The lazy rubist using shell way
Credit: @rynaro