Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Rust

on:
push:
branches: [ "main" ]
branches: [ "master" ]
pull_request:
branches: [ "main" ]
branches: [ "master" ]

env:
CARGO_TERM_COLOR: always
Expand Down
5 changes: 1 addition & 4 deletions src/internal_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,7 @@ pub fn vec_to_map(
Some(n) => n.try_into()?,
None => {
return Err(ParseError::KeyError {
msg: format!(
"The name of the action {} must be specified",
name
),
msg: format!("The name of the action {} must be specified", name),
})
}
},
Expand Down
16 changes: 8 additions & 8 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,19 +296,19 @@ fn set_optional_locale_str(
*opt = Some(inner);
};
Ok(())
},
}
}
}

fn set_bool(parts: LinePart, val: &mut bool) -> Result<(), ParseError> {
*val = parts
.value
.parse::<bool>()
.map_err(|_| ParseError::Syntax {
msg: "Property's value needs to be bool".into(),
row: parts.line_number,
col: 0,
})?;
.value
.parse::<bool>()
.map_err(|_| ParseError::Syntax {
msg: "Property's value needs to be bool".into(),
row: parts.line_number,
col: 0,
})?;
Ok(())
}

Expand Down
4 changes: 2 additions & 2 deletions src/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
//! [freedesktop.org Desktop Entry Specification](https://specifications.freedesktop.org/desktop-entry-spec/latest/).
//! Desktop entries are used to describe applications, shortcuts, and directories in desktop environments.

use std::{collections::HashMap, path::PathBuf, str::FromStr};
use std::fmt::Display;
use std::{collections::HashMap, path::PathBuf, str::FromStr};
use thiserror::Error;

/// A string that can have different values based on the system locale.
Expand Down Expand Up @@ -117,7 +117,7 @@ pub struct LinkFields {

/// The type of desktop entry, which determines its behavior and required fields.
#[derive(Debug, Clone, Default)]
// Clippy suggests using Box<ApplicationFields> for Application instead
// Clippy suggests using Box<ApplicationFields> for Application instead
// but this would break compatibility, so we disable the warning.
#[allow(clippy::large_enum_variant)]
pub enum EntryType {
Expand Down