Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format README example #224

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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