Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelklishin committed Jan 3, 2025
1 parent e6e609f commit 7e5a40b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ use std::borrow::Cow;
#[cfg(feature = "tabled")]
use tabled::Tabled;

#[cfg(windows)]
const LINE_ENDING: &str = "\r\n";
#[cfg(not(windows))]
const LINE_ENDING: &str = "\n";

#[allow(dead_code)]
fn fmt_list_as_json_array(f: &mut fmt::Formatter<'_>, xs: &[String]) -> fmt::Result {
match xs.len() {
Expand Down Expand Up @@ -78,7 +73,7 @@ fn fmt_vertical_list_with_bullets(f: &mut fmt::Formatter<'_>, xs: &[String]) ->
let mut xs = xs.to_owned();
let last_element = xs.pop().unwrap();
for elem in xs {
write!(f, "* {}{}", elem, LINE_ENDING)?;
write!(f, "* {}", elem)?;
}
write!(f, "* {}", last_element)?;
Ok(())
Expand All @@ -95,7 +90,7 @@ fn fmt_vertical_list_without_bullets(f: &mut fmt::Formatter<'_>, xs: &[String])
let mut xs = xs.to_owned();
let last_element = xs.pop().unwrap();
for elem in xs {
write!(f, "{}{}", elem, LINE_ENDING)?;
write!(f, "{}", elem)?;
}
write!(f, "{}", last_element)?;
Ok(())
Expand Down

0 comments on commit 7e5a40b

Please sign in to comment.