Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style(fmt): remove warnings #3701

Merged
merged 1 commit into from
Oct 25, 2024
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 default-plugins/fixture-plugin-for-tests/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ impl ZellijPlugin for State {
},
BareKey::Char('y') if key.has_modifiers(&[KeyModifier::Alt]) => {
let write_to_disk = true;
let mut keys_to_unbind = vec![
let keys_to_unbind = vec![
(
InputMode::Locked,
KeyWithModifier::new(BareKey::Char('g')).with_ctrl_modifier(),
Expand Down Expand Up @@ -481,7 +481,7 @@ impl ZellijPlugin for State {
KeyWithModifier::new(BareKey::Char('g')).with_ctrl_modifier(),
),
];
let mut keys_to_rebind = vec![
let keys_to_rebind = vec![
(
InputMode::Locked,
KeyWithModifier::new(BareKey::Char('a')).with_ctrl_modifier(),
Expand Down
2 changes: 0 additions & 2 deletions default-plugins/session-manager/src/ui/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,12 +532,10 @@ pub fn render_screen_toggle(
let key_indication_len = key_indication_text.chars().count() + 1;
let first_ribbon_length = new_session_text.chars().count() + 4;
let second_ribbon_length = running_sessions_text.chars().count() + 4;
let third_ribbon_length = exited_sessions_text.chars().count() + 4;
let key_indication_x = x;
let first_ribbon_x = key_indication_x + key_indication_len;
let second_ribbon_x = first_ribbon_x + first_ribbon_length;
let third_ribbon_x = second_ribbon_x + second_ribbon_length;
let reset_x = third_ribbon_x + third_ribbon_length + 1;
let mut new_session_text = Text::new(new_session_text);
let mut running_sessions_text = Text::new(running_sessions_text);
let mut exited_sessions_text = Text::new(exited_sessions_text);
Expand Down
8 changes: 1 addition & 7 deletions default-plugins/tab-bar/src/line.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
use ansi_term::ANSIStrings;
use ansi_term::{
Color::{Fixed, RGB},
Style,
};
use unicode_width::UnicodeWidthStr;

use crate::{LinePart, ARROW_SEPARATOR};
use zellij_tile::prelude::actions::Action;
use zellij_tile::prelude::*;
use zellij_tile_utils::{palette_match, style};
use zellij_tile_utils::style;

fn get_current_title_len(current_title: &[LinePart]) -> usize {
current_title.iter().map(|p| p.len).sum()
Expand Down Expand Up @@ -251,7 +247,6 @@ pub fn tab_line(
} else {
tab_info.and_then(|tab_info| {
swap_layout_status(
cols,
&tab_info.active_swap_layout_name,
tab_info.is_swap_layout_dirty,
mode_info,
Expand Down Expand Up @@ -307,7 +302,6 @@ pub fn tab_line(
}

fn swap_layout_status(
cols: usize,
swap_layout_name: &Option<String>,
is_swap_layout_dirty: bool,
mode_info: &ModeInfo,
Expand Down
9 changes: 6 additions & 3 deletions zellij-utils/src/input/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1229,17 +1229,20 @@ impl Layout {
),
}
}
#[cfg(not(target_family = "wasm"))]
pub fn stringified_from_url(url: &str) -> Result<String, ConfigError> {
#[cfg(not(target_family = "wasm"))]
let raw_layout = task::block_on(async move {
let download = Downloader::download_without_cache(url).await;
match download {
Ok(stringified) => Ok(stringified),
Err(e) => Err(ConfigError::DownloadError(format!("{}", e))),
}
})?;
Ok(raw_layout)
}
#[cfg(target_family = "wasm")]
pub fn stringified_from_url(_url: &str) -> Result<String, ConfigError> {
// silently fail - this should not happen in plugins and legacy architecture is hard
#[cfg(target_family = "wasm")]
let raw_layout = String::new();
Ok(raw_layout)
}
Expand Down Expand Up @@ -1284,7 +1287,7 @@ impl Layout {
Ok((layout, config))
}
#[cfg(target_family = "wasm")]
pub fn from_url(url: &str, config: Config) -> Result<(Layout, Config), ConfigError> {
pub fn from_url(_url: &str, _config: Config) -> Result<(Layout, Config), ConfigError> {
Err(ConfigError::DownloadError(format!(
"Unsupported platform, cannot download layout from the web"
)))
Expand Down
Loading