Skip to content

Commit

Permalink
Merge pull request #8 from TheBestTvarynka/refactor/ci
Browse files Browse the repository at this point in the history
Update CI config and fix clippy warnings
  • Loading branch information
TheBestTvarynka authored Mar 17, 2024
2 parents e807dd9 + ff5b2fd commit 781a090
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
run: 'cargo +nightly fmt --all -- --check'

- name: 'Clippy'
run: 'cargo clippy -- -D warnings'
run: 'cargo clippy --all-targets --all-features -- -D warnings'
4 changes: 2 additions & 2 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: 'cargo +nightly fmt --all -- --check'

- name: 'Clippy'
run: 'cargo clippy --all-features -- -D warnings'
run: 'cargo clippy --all-features --all-targets -- -D warnings'

check-examples-matrix:
strategy:
Expand All @@ -47,7 +47,7 @@ jobs:
run: 'cd examples/${{ matrix.example }} && cargo +nightly fmt --all -- --check'

- name: 'Clippy'
run: 'cd examples/${{ matrix.example }} && cargo clippy -- -D warnings'
run: 'cd examples/${{ matrix.example }} && cargo clippy --all-targets --all-features -- -D warnings'

deploy-documentation:
name: Deploy documentation
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fn inner(props: &InnerProps) -> Html {

#[function_component(App)]
pub fn app() -> Html {
let component_creator = NotificationFactory::default();
let component_creator = NotificationFactory;
let position = use_state(|| NotificationsPosition::TopRight);
let position_setter = position.setter();

Expand Down
2 changes: 1 addition & 1 deletion examples/custom/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn inner() -> Html {

#[function_component(App)]
pub fn app() -> Html {
let component_creator = CustomNotificationFactory::default();
let component_creator = CustomNotificationFactory;

html! {
<div>
Expand Down
2 changes: 1 addition & 1 deletion examples/terminal/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn inner() -> Html {

#[function_component(App)]
pub fn app() -> Html {
let component_creator = TerminalNotificationFactory::default();
let component_creator = TerminalNotificationFactory;
let position = NotificationsPosition::Custom("terminal-notifications".into());

html! {
Expand Down
2 changes: 1 addition & 1 deletion examples/terminal/src/notification/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl Notifiable for TerminalNotification {
}

fn apply_tick(&mut self, time: Duration) {
self.lifetime = self.lifetime.checked_sub(time).unwrap_or(Duration::default());
self.lifetime = self.lifetime.checked_sub(time).unwrap_or_default();
}

fn is_alive(&self) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion src/notification/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ impl Notifiable for Notification {
}

fn apply_tick(&mut self, time: Duration) {
self.lifetime = self.lifetime.checked_sub(time).unwrap_or(Duration::default());
self.lifetime = self.lifetime.checked_sub(time).unwrap_or_default();
}

fn is_alive(&self) -> bool {
Expand Down

0 comments on commit 781a090

Please sign in to comment.