forked from github-starred/komodo
string deser filter empty lines
This commit is contained in:
@@ -64,7 +64,9 @@ impl std::fmt::Display for Color {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Color::Red => f.write_str("text-red-700 dark:text-red-400"),
|
||||
Color::Green => f.write_str("text-green-700 dark:text-green-400"),
|
||||
Color::Green => {
|
||||
f.write_str("text-green-700 dark:text-green-400")
|
||||
}
|
||||
Color::Blue => f.write_str("text-blue-700 dark:text-blue-400"),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,8 +300,10 @@ pub async fn get_updates_for_view<Resource: ResourceSync>(
|
||||
));
|
||||
}
|
||||
if resource.tags != original_tags {
|
||||
let from = colored(&format!("{:?}", original_tags), Color::Red);
|
||||
let to = colored(&format!("{:?}", resource.tags), Color::Green);
|
||||
let from =
|
||||
colored(&format!("{:?}", original_tags), Color::Red);
|
||||
let to =
|
||||
colored(&format!("{:?}", resource.tags), Color::Green);
|
||||
lines.push(format!(
|
||||
"{}: 'tags'\n{}: {from}\n{}: {to}",
|
||||
muted("field"),
|
||||
|
||||
@@ -22,7 +22,8 @@ use crate::{
|
||||
resource::{
|
||||
run_update_description, run_update_tags, ResourceSync,
|
||||
ToUpdateItem,
|
||||
}, Color,
|
||||
},
|
||||
Color,
|
||||
},
|
||||
resource::MonitorResource,
|
||||
};
|
||||
|
||||
@@ -22,7 +22,9 @@ use resolver_api::Resolve;
|
||||
|
||||
use crate::state::{db_client, State};
|
||||
|
||||
use super::{bold, colored, muted, resource::AllResourcesById, Color};
|
||||
use super::{
|
||||
bold, colored, muted, resource::AllResourcesById, Color,
|
||||
};
|
||||
|
||||
pub struct UpdateItem {
|
||||
user_group: UserGroupToml,
|
||||
|
||||
@@ -307,7 +307,7 @@ pub fn conversions_from_str(
|
||||
.split('\n')
|
||||
.map(|line| line.trim())
|
||||
.enumerate()
|
||||
.filter(|(_, line)| !line.starts_with('#'))
|
||||
.filter(|(_, line)| !line.is_empty() && !line.starts_with('#'))
|
||||
.map(|(i, line)| {
|
||||
let mut split = line.split('=');
|
||||
let local = split
|
||||
@@ -616,7 +616,7 @@ pub fn term_signal_labels_from_str(
|
||||
.split('\n')
|
||||
.map(|line| line.trim())
|
||||
.enumerate()
|
||||
.filter(|(_, line)| !line.starts_with('#'))
|
||||
.filter(|(_, line)| !line.is_empty() && !line.starts_with('#'))
|
||||
.map(|(i, line)| {
|
||||
let mut split = line.split('=');
|
||||
let signal = split
|
||||
|
||||
@@ -355,7 +355,7 @@ pub fn environment_vars_from_str(
|
||||
.split('\n')
|
||||
.map(|line| line.trim())
|
||||
.enumerate()
|
||||
.filter(|(_, line)| !line.starts_with('#'))
|
||||
.filter(|(_, line)| !line.is_empty() && !line.starts_with('#'))
|
||||
.map(|(i, line)| {
|
||||
let mut split = line.split('=');
|
||||
let variable = split
|
||||
|
||||
Reference in New Issue
Block a user