Skip to content

Commit

Permalink
Add prelude module
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Aug 18, 2024
1 parent 5f66045 commit b6be46c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ url = "2"
```

```rust,no_run
use ntfy::payload::{Action, ActionType};
use ntfy::{Auth, Dispatcher, NtfyError, Payload, Priority};
use url::Url;
use ntfy::prelude::*;
#[tokio::main]
async fn main() -> Result<(), NtfyError> {
Expand Down
4 changes: 1 addition & 3 deletions examples/blocking.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) 2022 Yuki Kishimoto
// Distributed under the MIT software license

use ntfy::payload::{Action, ActionType};
use ntfy::{Auth, Dispatcher, NtfyError, Payload, Priority};
use url::Url;
use ntfy::prelude::*;

fn main() -> Result<(), NtfyError> {
let dispatcher = Dispatcher::builder("https://ntfy.sh")
Expand Down
4 changes: 1 addition & 3 deletions examples/client.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) 2022 Yuki Kishimoto
// Distributed under the MIT software license

use ntfy::payload::{Action, ActionType};
use ntfy::{Auth, Dispatcher, NtfyError, Payload, Priority};
use url::Url;
use ntfy::prelude::*;

#[tokio::main]
async fn main() -> Result<(), NtfyError> {
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub mod dispatcher;
pub mod error;
mod net;
pub mod payload;
pub mod prelude;

pub use self::dispatcher::{Auth, Dispatcher, DispatcherBuilder};
pub use self::error::NtfyError;
Expand Down
14 changes: 14 additions & 0 deletions src/prelude.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) 2022 Yuki Kishimoto
// Distributed under the MIT software license

//! Prelude
#![allow(unknown_lints)]
#![allow(ambiguous_glob_reexports)]
#![doc(hidden)]

pub use url::Url;

pub use crate::dispatcher::*;
pub use crate::payload::*;
pub use crate::*;

0 comments on commit b6be46c

Please sign in to comment.