1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-28 07:46:28 +00:00
starship/src/modules/line_break.rs
2021-09-12 19:59:15 -04:00

24 lines
553 B
Rust

use super::{Context, Module};
use crate::segment::Segment;
/// Creates a module for the line break
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
let mut module = context.new_module("line_break");
module.set_segments(vec![Segment::LineTerm]);
Some(module)
}
#[cfg(test)]
mod test {
use crate::test::ModuleRenderer;
#[test]
fn produces_result() {
let expected = Some(String::from("\n"));
let actual = ModuleRenderer::new("line_break").collect();
assert_eq!(expected, actual);
}
}