Skip to content

Commit

Permalink
chore: switch from allow(x) to expect(x)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Sep 7, 2024
1 parent 2def1b0 commit 3104553
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src-tauri/src/db/models/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct ModelStats {
}

impl ModelStats {
#[allow(unused)]
#[expect(unused)]
pub async fn get(sqlite: SqlitePool) -> Result<Vec<Self>, AppError> {
let query = "SELECT * FROM stats";
Ok(sqlx::query_as::<_, Self>(query).fetch_all(&sqlite).await?)
Expand Down
4 changes: 1 addition & 3 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Only allow when debugging
// #![allow(unused)]
#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
Expand Down Expand Up @@ -116,7 +114,7 @@ async fn main() -> Result<(), ()> {
let handler_sx = sx.clone();
let tray_sx = sx.clone();

#[allow(unused_variables)]
#[expect(unused_variables)]
let app_builder = tauri::Builder::default()
.manage(state)
.setup(|app| {
Expand Down
24 changes: 11 additions & 13 deletions src-tauri/src/request_handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ fn auto_launch() -> Option<AutoLaunch> {

/// Initialise the fontend store & settings
#[tauri::command]
#[allow(clippy::needless_pass_by_value)]
pub fn init(state: TauriState<'_>) {
for message in [
Emitter::Settings,
Expand All @@ -37,7 +36,7 @@ pub fn init(state: TauriState<'_>) {

/// Request to reset settings to default
#[tauri::command]
#[allow(clippy::needless_pass_by_value)]
#[expect(clippy::needless_pass_by_value)]
pub fn reset_settings(state: TauriState<'_>) {
state
.lock()
Expand All @@ -48,7 +47,6 @@ pub fn reset_settings(state: TauriState<'_>) {

/// Toggle the autostart option
#[tauri::command]
#[allow(clippy::needless_pass_by_value)]
pub fn set_autostart(state: TauriState<'_>, value: bool) {
if let Some(i) = auto_launch() {
if value {
Expand All @@ -62,21 +60,21 @@ pub fn set_autostart(state: TauriState<'_>, value: bool) {

/// Toggle the pause option
#[tauri::command]
#[allow(clippy::needless_pass_by_value)]
#[expect(clippy::needless_pass_by_value)]
pub fn toggle_pause(state: TauriState<'_>) {
state.lock().sx.send(InternalMessage::Pause).ok();
}

/// Set the pause after break setting
#[tauri::command]
#[allow(clippy::needless_pass_by_value)]
#[expect(clippy::needless_pass_by_value)]
pub fn pause_after_break(state: TauriState<'_>, pause: bool) {
state.lock().pause_after_break = pause;
}

/// Get the current status of the autostart setting
#[tauri::command]
#[allow(clippy::needless_pass_by_value)]
#[expect(clippy::needless_pass_by_value)]
pub fn get_autostart(state: TauriState<'_>) {
state
.lock()
Expand All @@ -89,7 +87,7 @@ pub fn get_autostart(state: TauriState<'_>) {

/// Request to set the full screen setting to the given boolean value
#[tauri::command]
#[allow(clippy::needless_pass_by_value)]
#[expect(clippy::needless_pass_by_value)]
pub fn set_setting_fullscreen(state: TauriState<'_>, value: bool) {
state
.lock()
Expand All @@ -102,7 +100,7 @@ pub fn set_setting_fullscreen(state: TauriState<'_>, value: bool) {

/// Request to set the full screen setting to the given boolean value
#[tauri::command]
#[allow(clippy::needless_pass_by_value)]
#[expect(clippy::needless_pass_by_value)]
pub fn open_database_location(state: TauriState<'_>) {
open::that(state.lock().get_data_location()).ok();
state
Expand All @@ -114,7 +112,7 @@ pub fn open_database_location(state: TauriState<'_>) {

/// Request to set the session length to the given i64 value
#[tauri::command]
#[allow(clippy::needless_pass_by_value)]
#[expect(clippy::needless_pass_by_value)]
pub fn set_setting_session(state: TauriState<'_>, value: u16) {
state
.lock()
Expand All @@ -127,7 +125,7 @@ pub fn set_setting_session(state: TauriState<'_>, value: u16) {

/// Request to set the long_break length to the given i64 value
#[tauri::command]
#[allow(clippy::needless_pass_by_value)]
#[expect(clippy::needless_pass_by_value)]
pub fn set_setting_longbreak(state: TauriState<'_>, value: u16) {
state
.lock()
Expand All @@ -140,7 +138,7 @@ pub fn set_setting_longbreak(state: TauriState<'_>, value: u16) {

/// Request to set the short_break length to the given i64 value
#[tauri::command]
#[allow(clippy::needless_pass_by_value)]
#[expect(clippy::needless_pass_by_value)]
pub fn set_setting_shortbreak(state: TauriState<'_>, value: u8) {
state
.lock()
Expand All @@ -153,7 +151,7 @@ pub fn set_setting_shortbreak(state: TauriState<'_>, value: u8) {

/// Request to set the number of sessions before long_break to the given u8 value
#[tauri::command]
#[allow(clippy::needless_pass_by_value)]
#[expect(clippy::needless_pass_by_value)]
pub fn set_setting_number_sessions(state: TauriState<'_>, value: u8) {
state
.lock()
Expand All @@ -166,7 +164,7 @@ pub fn set_setting_number_sessions(state: TauriState<'_>, value: u8) {

/// Request to minimize the application window
#[tauri::command]
#[allow(clippy::needless_pass_by_value)]
#[expect(clippy::needless_pass_by_value)]
pub fn minimize(state: TauriState<'_>) {
state
.lock()
Expand Down

0 comments on commit 3104553

Please sign in to comment.