Skip to content

Commit

Permalink
Merge pull request #224 from allan2/main
Browse files Browse the repository at this point in the history
Format README example
  • Loading branch information
hannobraun authored Sep 18, 2024
2 parents cce05f6 + b765e5a commit 3022fb5
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,14 @@

Idiomatic [inotify] wrapper for the [Rust programming language].

```Rust
extern crate inotify;


```rs
use inotify::{EventMask, Inotify, WatchMask};
use std::env;

use inotify::{
EventMask,
WatchMask,
Inotify,
};


fn main() {
let mut inotify = Inotify::init()
.expect("Failed to initialize inotify");
let mut inotify = Inotify::init().expect("Failed to initialize inotify");

let current_dir = env::current_dir()
.expect("Failed to determine current directory");
let current_dir = env::current_dir().expect("Failed to determine current directory");

inotify
.watches()
Expand Down Expand Up @@ -63,7 +52,6 @@ fn main() {
}
```


## Usage

Include it in your `Cargo.toml`:
Expand All @@ -79,7 +67,6 @@ Please note that inotify-rs is a relatively low-level wrapper around the origina

If you need to access inotify in a way that this wrapper doesn't support, consider using [inotify-sys] instead.


## Documentation

The most important piece of documentation for inotify-rs is the **[API reference]**, as it contains a thorough description of the complete API, as well as examples.
Expand All @@ -88,7 +75,6 @@ Additional examples can be found in the **[examples directory]**.

Please also make sure to read the **[inotify man page]**. Inotify use can be hard to get right, and this low-level wrapper won't protect you from all mistakes.


## License

Copyright (c) Hanno Braun and contributors
Expand All @@ -105,7 +91,6 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.


[inotify]: http://en.wikipedia.org/wiki/Inotify
[Rust programming language]: http://rust-lang.org/
[documentation]: https://docs.rs/inotify
Expand Down

0 comments on commit 3022fb5

Please sign in to comment.