Skip to content

Commit

Permalink
Update deps, fix new lints, update deny
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusGrass committed Apr 17, 2024
1 parent eab0400 commit a2df74a
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 115 deletions.
134 changes: 42 additions & 92 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ x11-keysyms = { version = "0.1.0", features = ["miscellany", "latin1"] }

atoi = { version = "2.0.0", default-features = false }

hashbrown = { version = "0.14.0", default-features = false }
heapless = { version = "0.7.16", default-features = false }
hashbrown = { version = "0.14.3", default-features = false }
heapless = { version = "0.8.0", default-features = false }

smallmap = { version = "1.4.1", default-features = false }
time = { version = "0.3.28", default-features = false }
smallmap = { version = "1.4.2", default-features = false }
time = { version = "0.3.36", default-features = false }
13 changes: 1 addition & 12 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[graph]
targets = [
{ triple = "x86_64-unknown-linux-gnu" },
{ triple = "x86_64-unknown-linux-musl" },
Expand All @@ -6,11 +7,6 @@ targets = [
]

[advisories]
vulnerability = "deny"
unmaintained = "deny"
unsound = "deny"
yanked = "deny"
notice = "deny"
ignore = []

[bans]
Expand All @@ -29,9 +25,6 @@ deny = [
{ name = "libc" },
]
skip = [
# Clash in build deps between heapless and smallmap
{ name = "semver", version = "0.9.0" },
{ name = "rustc_version", version = "0.2.3" },
]

[sources]
Expand All @@ -40,11 +33,7 @@ allow-git = [
]

[licenses]
unlicensed = "deny"
allow-osi-fsf-free = "neither"
confidence-threshold = 1.0
# I'd like to know if they pop into my dependency graph
copyleft = "deny"
allow = [
"Apache-2.0",
"MIT",
Expand Down
1 change: 1 addition & 0 deletions pgwm-app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#![allow(clippy::module_name_repetitions)]
// Debug log complaints
#![allow(clippy::used_underscore_binding)]
#![allow(clippy::struct_field_names)]
#![cfg_attr(not(test), no_std)]

extern crate alloc;
Expand Down
3 changes: 2 additions & 1 deletion pgwm-app/src/manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,7 @@ impl<'a> Manager<'a> {
let data = event.data.0.as_iter_32();

// 1st and 2nd bytes are possible atoms to change
#[allow(clippy::unused_enumerate_index)]
for (_i, value) in data.take(3).enumerate() {
if let Some(resolved) = call_wrapper.resolve_atom(value) {
pgwm_utils::debug!("Resolved atom in position {_i} to {resolved:?}");
Expand Down Expand Up @@ -1366,7 +1367,7 @@ impl<'a> Manager<'a> {
self.update_current_window_title_and_redraw(
call_wrapper,
mon_ind,
heapless::String::from("pgwm"),
heapless::String::try_from("pgwm").unwrap(),
state,
)?;
pgwm_utils::debug!("Focused root on mon = {}", mon_ind);
Expand Down
9 changes: 6 additions & 3 deletions pgwm-app/src/x11/call_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ impl NameCookie {

fn utf8_heapless<const N: usize>(bytes: Vec<u8>) -> Result<Option<heapless::String<N>>> {
let slice = &bytes[..N.min(bytes.len())];
Ok(core::str::from_utf8(slice).map(|s| Some(heapless::String::from(s)))?)
Ok(core::str::from_utf8(slice).map(|s| heapless::String::try_from(s).ok())?)
}

pub(crate) struct WmClassCookie {
Expand All @@ -1631,8 +1631,11 @@ fn extract_wm_class(
if let Ok(raw_utf8) = &raw_utf8 {
let complete_names = raw_utf8
.split('\u{0}')
.filter(|s| !s.is_empty())
.map(heapless::String::from)
.filter_map(|s| {
(!s.is_empty())
.then(|| heapless::String::try_from(s).ok())
.flatten()
})
// Avoiding another alloc here
.collect::<heapless::Vec<heapless::String<_WM_CLASS_NAME_LIMIT>, 4>>();
Some(complete_names)
Expand Down
2 changes: 1 addition & 1 deletion pgwm-app/src/x11/state_lifecycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ fn do_create_state<'a>(
hosted_workspace: i,
last_focus: None,
show_bar: WM_SHOW_BAR_INITIALLY,
window_title_display: heapless::String::from("pgwm"),
window_title_display: heapless::String::try_from("pgwm").unwrap(),
};
monitors.push(new_mon);
}
Expand Down
7 changes: 6 additions & 1 deletion pgwm-core/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,12 @@ pub enum DefaultDraw {
pub const USER_WORKSPACES: [UserWorkspace; 9] = [
UserWorkspace::new(
"\u{f121}",
&["jetbrains-rustrover", "jetbrains-clion", "jetbrains-idea", "lapce"],
&[
"jetbrains-rustrover",
"jetbrains-clion",
"jetbrains-idea",
"lapce",
],
DefaultDraw::LeftLeader,
),
UserWorkspace::new("\u{f120}", &[], DefaultDraw::LeftLeader),
Expand Down
2 changes: 1 addition & 1 deletion pgwm-core/src/state/bar_geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl BarGeometry {
workspace.position.start + workspace.position.length,
title_width,
),
display: heapless::String::from("pgwm"),
display: heapless::String::try_from("pgwm").unwrap(),
last_draw_width: title_width, // Set last draw to full with so initial draw, paints the entire section
},
workspace,
Expand Down

0 comments on commit a2df74a

Please sign in to comment.