Skip to content

Commit

Permalink
Merge pull request #231 from hoodie/feature/librs-warnings
Browse files Browse the repository at this point in the history
maintainance
  • Loading branch information
hoodie authored Sep 10, 2024
2 parents 2bd2a2c + 6312e9c commit eae8a38
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 35 deletions.
22 changes: 22 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--
First and foremost, thank you for taking the time to contribute to this project! Your efforts are greatly appreciated.
## Semantic Commit Messages
Please ensure your commit messages follows the [Conventional Commits Specification](https://www.conventionalcommits.org/en/v1.0.0/),
as these are being used to automatically generate the changelog and determine the version bump for releases.
Most importantly: [Mark breaking changes accordingly](https://www.conventionalcommits.org/en/v1.0.0/#commit-message-with-description-and-breaking-change-footer)!
### Example
```
feat: add new user authentication module
fix: resolve issue with user not being able to login
feat!: remove deprecated user module
```
->>
Again, thank you for your contribution!
If you have any questions or need assistance, don't hesitate to ask. We're here to help!
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ jobs:
name: Pull Request Check
uses: ./.github/workflows/pull-request.yml

semver:
name: cargo-semver-checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: check semver
uses: obi1kenobi/cargo-semver-checks-action@v2.6

linux:
name: linux
needs: pr_check
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ include = [

[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
dbus = { version = "0.9", optional = true }
lazy_static = { version = "1", optional = true }
lazy_static = { version = "1.5", optional = true }
image = { version = "0.25", optional = true }
zbus = { version = "4", optional = true }
serde = { version = "1", optional = true }
Expand All @@ -38,7 +38,7 @@ winrt-notification = { package = "tauri-winrt-notification", version = "0.2" }

[features]
default = ["z"]
#`server = []
# server = []
d = ["dbus"]
d_vendored = ["dbus/vendored"]
z = ["zbus", "serde", "async"]
Expand Down
8 changes: 3 additions & 5 deletions src/hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ pub(crate) enum CustomHintType {

/// `Hints` allow you to pass extra information to the server.
///
/// Many of these are standardized by either:
/// Many of these are standardized by:
///
/// * <http://www.galago-project.org/specs/notification/0.9/x344.html>
/// * <https://developer.gnome.org/notification-spec/#hints>
/// * <https://specifications.freedesktop.org/notification-spec/latest/hints.html>
///
/// Which of these are actually implemented depends strongly on the Notification server you talk to.
/// Usually the [`get_capabilities()`](`crate::get_capabilities`) gives some clues, but the standards usually mention much more
Expand All @@ -44,8 +43,7 @@ pub enum Hint {

/// Check out:
///
/// * <http://www.galago-project.org/specs/notification/0.9/x211.html>
/// * <https://developer.gnome.org/notification-spec/#categories>
/// * <https://specifications.freedesktop.org/notification-spec/latest/hints.html>
Category(String),

/// Name of the `DesktopEntry` representing the calling application. In case of "firefox.desktop"
Expand Down
7 changes: 2 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ mod xdg;
#[cfg(all(feature = "images", unix, not(target_os = "macos")))]
mod image;

#[cfg(all(feature = "server", feature = "dbus", unix, not(target_os = "macos")))]
pub mod server;

#[cfg(target_os = "macos")]
pub use mac_notification_sys::{get_bundle_identifier_or_default, set_application};

Expand All @@ -198,8 +195,8 @@ pub use crate::xdg::{
CloseHandler, CloseReason, DbusStack, NotificationHandle,
};

#[cfg(all(feature = "server", unix, not(target_os = "macos")))]
pub use crate::xdg::stop_server;
// #[cfg(all(feature = "server", unix, not(target_os = "macos")))]
// pub use crate::xdg::stop_server;

pub use crate::hints::Hint;

Expand Down
2 changes: 1 addition & 1 deletion src/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ impl Notification {
windows::show_notification(self)
}

/// Wraps [`show()`] but prints notification to stdout.
/// Wraps [`Notification::show()`] but prints notification to stdout.
#[cfg(all(unix, not(target_os = "macos")))]
#[deprecated = "this was never meant to be public API"]
pub fn show_debug(&mut self) -> Result<xdg::NotificationHandle> {
Expand Down
26 changes: 13 additions & 13 deletions src/urgency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,25 @@ impl From<Option<u64>> for Urgency {
}

// TODO: remove this in v5.0
#[cfg(not(feature = "server"))]
// #[cfg(not(feature = "server"))]
impl From<u64> for Urgency {
fn from(int: u64) -> Urgency {
match int {
0 => Urgency::Low,
1 => Urgency::Normal,
2..=std::u64::MAX => Urgency::Critical,
2..=u64::MAX => Urgency::Critical,
}
}
}

// TODO: make this the default in v5.0
#[cfg(feature = "server")]
impl From<u8> for Urgency {
fn from(int: u8) -> Urgency {
match int {
0 => Urgency::Low,
1 => Urgency::Normal,
2..=std::u8::MAX => Urgency::Critical,
}
}
}
// // TODO: make this the default in v5.0
// #[cfg(feature = "server")]
// impl From<u8> for Urgency {
// fn from(int: u8) -> Urgency {
// match int {
// 0 => Urgency::Low,
// 1 => Urgency::Normal,
// 2..=std::u8::MAX => Urgency::Critical,
// }
// }
// }
18 changes: 9 additions & 9 deletions src/xdg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,15 +467,15 @@ pub struct ServerInformation {
pub spec_version: String,
}

/// Strictly internal.
/// The NotificationServer implemented here exposes a "Stop" function.
/// stops the notification server
#[cfg(all(feature = "server", unix, not(target_os = "macos")))]
#[doc(hidden)]
pub fn stop_server() {
#[cfg(feature = "dbus")]
dbus_rs::stop_server()
}
// /// Strictly internal.
// /// The NotificationServer implemented here exposes a "Stop" function.
// /// stops the notification server
// #[cfg(all(feature = "server", unix, not(target_os = "macos")))]
// #[doc(hidden)]
// pub fn stop_server() {
// #[cfg(feature = "dbus")]
// dbus_rs::stop_server()
// }

/// Listens for the `ActionInvoked(UInt32, String)` Signal.
///
Expand Down

0 comments on commit eae8a38

Please sign in to comment.