pub struct Separated<Sep, Iter>{
pub sep: Sep,
pub iter: Iter,
}
Expand description
Note: only the Display impl is special; the Debug impl is just a #[derive]
.
Use https://crates.io/crates/fmt_adapter if this is an issue.
use fmt_utils::std::Separated;
assert_eq!(Separated { sep: ',', iter: &[] as &[char] }.to_string(), "");
assert_eq!(Separated { sep: ',', iter: &['a'] }.to_string(), "a");
assert_eq!(Separated { sep: ',', iter: &['a', 'b'] }.to_string(), "a,b");
assert_eq!(Separated { sep: ',', iter: &['a', 'b', 'c'] }.to_string(), "a,b,c");
Fields§
§sep: Sep
§iter: Iter
Trait Implementations§
impl<Sep, Iter> Copy for Separated<Sep, Iter>
Auto Trait Implementations§
impl<Sep, Iter> Freeze for Separated<Sep, Iter>
impl<Sep, Iter> RefUnwindSafe for Separated<Sep, Iter>where
Sep: RefUnwindSafe,
Iter: RefUnwindSafe,
impl<Sep, Iter> Send for Separated<Sep, Iter>
impl<Sep, Iter> Sync for Separated<Sep, Iter>
impl<Sep, Iter> Unpin for Separated<Sep, Iter>
impl<Sep, Iter> UnwindSafe for Separated<Sep, Iter>where
Sep: UnwindSafe,
Iter: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more