formating changes

This commit is contained in:
Bryan Ndjeutcha 2021-08-19 14:55:14 -04:00
parent 92e08c60f8
commit f72cd1b35b

View File

@ -62,27 +62,37 @@ impl Env {
print!("{{"); print!("{{");
let mut i = 0; let mut i = 0;
let len = self.hashmap.len(); let len = self.hashmap.len();
for (key, val) in self.hashmap.iter() { if len > 0 {
print!("{:?} :", key); for (key, val) in self.hashmap.iter() {
match val { print!("{:?} :", key);
Value::Tags(tags) => { match val {
print!("["); Value::Tags(tags) => {
fmt_tags(*tags); print!("[");
print!("]"); fmt_tags(*tags);
print!("]");
}
Value::Title(title) => {
print!("{:?}", title);
}
Value::ViewsTag(tags) => {
print!("[");
let len = tags.len();
for (i, tag) in tags.iter().enumerate() {
print!("\"{}\"", tag);
if i < len - 1 {
print!(", ");
}
}
print!("]");
}
} }
Value::Title(title) => { i += 1;
print!("{:?}", title); if i < len {
} print!(", ");
Value::ViewsTag(tags) => {
print!("\"{:?}\"", tags);
} }
} }
i += 1; println!("}}");
if i < len {
print!(", ");
}
} }
println!("}}");
} }
} }
@ -150,9 +160,9 @@ fn main() {
{ {
if let Some(status_manager) = &env.status_manager { if let Some(status_manager) = &env.status_manager {
make = make.replace(' ', "").to_string(); make = make.replace(' ', "").to_string();
let tags_key = format!("Tags_{}", make); let tags_key = format!("Tags{}", make);
let urgent_key = format!("UrgentTags_{}", make); let urgent_key = format!("UrgentTags{}", make);
let views_key = format!("ViewsTags_{}", make); let views_key = format!("ViewsTag{}", make);
let output_status = let output_status =
status_manager.get_river_output_status(&output); status_manager.get_river_output_status(&output);
output_status.quick_assign(move |_, event, mut env| { output_status.quick_assign(move |_, event, mut env| {
@ -177,7 +187,7 @@ fn main() {
u32::from_le_bytes(buf); u32::from_le_bytes(buf);
for i in 0..32 { for i in 0..32 {
if 1 << i == tagmask { if 1 << i == tagmask {
return i; return 1+i;
} }
} }
0 0