Skip to content

Commit

Permalink
chore: apply clippy suggestions. (tauri-apps#11849)
Browse files Browse the repository at this point in the history
* chore: apply clippy suggestions.

* .

* .
  • Loading branch information
FabianLars authored Dec 2, 2024
1 parent 89e30ef commit 882b0ad
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion crates/tauri-bundler/src/bundle/category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ struct AppCategoryVisitor {
did_you_mean: Option<&'static str>,
}

impl<'d> serde::de::Visitor<'d> for AppCategoryVisitor {
impl serde::de::Visitor<'_> for AppCategoryVisitor {
type Value = AppCategory;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri-bundler/src/bundle/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ pub struct WixSettings {
pub banner_path: Option<PathBuf>,
/// Path to a bitmap file to use on the installation user interface dialogs.
/// It is used on the welcome and completion dialogs.
///
/// The required dimensions are 493px × 312px.
pub dialog_image_path: Option<PathBuf>,
/// Enables FIPS compliant algorithms.
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri-cli/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2535,7 +2535,7 @@
]
},
"dialogImagePath": {
"description": "Path to a bitmap file to use on the installation user interface dialogs.\n It is used on the welcome and completion dialogs.\n The required dimensions are 493px × 312px.",
"description": "Path to a bitmap file to use on the installation user interface dialogs.\n It is used on the welcome and completion dialogs.\n\n The required dimensions are 493px × 312px.",
"type": [
"string",
"null"
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri-cli/src/interface/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ mod pkgconfig_utils {
if !output.stdout.is_empty() {
// output would be "-L/path/to/library\n"
let word = output.stdout[2..].to_vec();
return Some(String::from_utf8_lossy(&word).trim().to_string());
Some(String::from_utf8_lossy(&word).trim().to_string())
} else {
None
}
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri-cli/src/interface/rust/desktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ mod terminal {
// INVALID_HANDLE_VALUE. Use an alternate method which works
// in that case as well.
let h = CreateFileA(
"CONOUT$\0".as_ptr() as PCSTR,
c"CONOUT$".as_ptr() as PCSTR,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
ptr::null_mut(),
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri-schema-generator/schemas/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2535,7 +2535,7 @@
]
},
"dialogImagePath": {
"description": "Path to a bitmap file to use on the installation user interface dialogs.\n It is used on the welcome and completion dialogs.\n The required dimensions are 493px × 312px.",
"description": "Path to a bitmap file to use on the installation user interface dialogs.\n It is used on the welcome and completion dialogs.\n\n The required dimensions are 493px × 312px.",
"type": [
"string",
"null"
Expand Down
4 changes: 2 additions & 2 deletions crates/tauri-utils/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ pub struct WixConfig {
pub banner_path: Option<PathBuf>,
/// Path to a bitmap file to use on the installation user interface dialogs.
/// It is used on the welcome and completion dialogs.
///
/// The required dimensions are 493px × 312px.
#[serde(alias = "dialog-image-path")]
pub dialog_image_path: Option<PathBuf>,
Expand Down Expand Up @@ -2644,7 +2644,7 @@ impl<'d> serde::Deserialize<'d> for PackageVersion {
fn deserialize<D: Deserializer<'d>>(deserializer: D) -> Result<Self, D::Error> {
struct PackageVersionVisitor;

impl<'d> Visitor<'d> for PackageVersionVisitor {
impl Visitor<'_> for PackageVersionVisitor {
type Value = PackageVersion;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
6 changes: 3 additions & 3 deletions crates/tauri-utils/src/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub struct ResourcePathsIter<'a> {
glob_iter: Option<glob::Paths>,
}

impl<'a> ResourcePathsIter<'a> {
impl ResourcePathsIter<'_> {
fn next_glob_iter(&mut self) -> Option<crate::Result<Resource>> {
let entry = self.glob_iter.as_mut().unwrap().next()?;

Expand Down Expand Up @@ -270,15 +270,15 @@ impl<'a> ResourcePathsIter<'a> {
}
}

impl<'a> Iterator for ResourcePaths<'a> {
impl Iterator for ResourcePaths<'_> {
type Item = crate::Result<PathBuf>;

fn next(&mut self) -> Option<crate::Result<PathBuf>> {
self.iter.next().map(|r| r.map(|res| res.path))
}
}

impl<'a> Iterator for ResourcePathsIter<'a> {
impl Iterator for ResourcePathsIter<'_> {
type Item = crate::Result<Resource>;

fn next(&mut self) -> Option<crate::Result<Resource>> {
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri/src/ipc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub struct Request<'a> {
headers: &'a HeaderMap,
}

impl<'a> Request<'a> {
impl Request<'_> {
/// The request body.
pub fn body(&self) -> &InvokeBody {
self.body
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ pub mod test;
const _: () = {
use specta::{datatype::DataType, function::FunctionArg, TypeMap};

impl<'r, T: Send + Sync + 'static> FunctionArg for crate::State<'r, T> {
impl<T: Send + Sync + 'static> FunctionArg for crate::State<'_, T> {
fn to_datatype(_: &mut TypeMap) -> Option<DataType> {
None
}
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<T: Send + Sync + 'static + PartialEq> PartialEq for State<'_, T> {
}
}

impl<'r, T: Send + Sync + std::fmt::Debug> std::fmt::Debug for State<'r, T> {
impl<T: Send + Sync + std::fmt::Debug> std::fmt::Debug for State<'_, T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_tuple("State").field(&self.0).finish()
}
Expand Down
2 changes: 1 addition & 1 deletion crates/tauri/src/webview/webview_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ impl<'a, R: Runtime, M: Manager<R>> WebviewWindowBuilder<'a, R, M> {
}

/// Webview attributes.
impl<'a, R: Runtime, M: Manager<R>> WebviewWindowBuilder<'a, R, M> {
impl<R: Runtime, M: Manager<R>> WebviewWindowBuilder<'_, R, M> {
/// Sets whether clicking an inactive window also clicks through to the webview.
#[must_use]
pub fn accept_first_mouse(mut self, accept: bool) -> Self {
Expand Down
4 changes: 2 additions & 2 deletions crates/tauri/src/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ unstable_struct!(
}
);

impl<'a, R: Runtime, M: Manager<R>> fmt::Debug for WindowBuilder<'a, R, M> {
impl<R: Runtime, M: Manager<R>> fmt::Debug for WindowBuilder<'_, R, M> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("WindowBuilder")
.field("label", &self.label)
Expand Down Expand Up @@ -846,7 +846,7 @@ impl<'a, R: Runtime, M: Manager<R>> WindowBuilder<'a, R, M> {
}
}

impl<'a, R: Runtime, M: Manager<R>> WindowBuilder<'a, R, M> {
impl<R: Runtime, M: Manager<R>> WindowBuilder<'_, R, M> {
/// Set the window and webview background color.
///
/// ## Platform-specific:
Expand Down

0 comments on commit 882b0ad

Please sign in to comment.