mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 17:57:19 +02:00
Merge pull request #38 from javabird25/lossy-description
Use String::from_utf8_lossy() for task description output
This commit is contained in:
commit
694ea0f351
1 changed files with 1 additions and 4 deletions
|
@ -393,10 +393,7 @@ impl TTApp {
|
||||||
let task_id = self.tasks.lock().unwrap()[selected].id().unwrap_or_default();
|
let task_id = self.tasks.lock().unwrap()[selected].id().unwrap_or_default();
|
||||||
let output = Command::new("task").arg(format!("{}", task_id)).output();
|
let output = Command::new("task").arg(format!("{}", task_id)).output();
|
||||||
if let Ok(output) = output {
|
if let Ok(output) = output {
|
||||||
let data = String::from_utf8(output.stdout).unwrap_or(format!(
|
let data = String::from_utf8_lossy(&*output.stdout);
|
||||||
"Unable to get description of task with id: {}. Please report as an issue on github.",
|
|
||||||
task_id
|
|
||||||
));
|
|
||||||
let p = Paragraph::new(Text::from(&data[..])).block(
|
let p = Paragraph::new(Text::from(&data[..])).block(
|
||||||
Block::default()
|
Block::default()
|
||||||
.borders(Borders::ALL)
|
.borders(Borders::ALL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue