diff --git a/src/segment.rs b/src/segment.rs index 3829c159..99f3c0a9 100644 --- a/src/segment.rs +++ b/src/segment.rs @@ -5,11 +5,12 @@ pub struct Segment { name: Option, style: Style, value: String, - prefix: OptionalSegment, - suffix: OptionalSegment, + prefix: BoxedSegment, + suffix: BoxedSegment, } impl Segment { + /// Creates a new segment with default fields pub fn new(name: T) -> Segment where T: Into, @@ -40,6 +41,9 @@ impl Segment { } } + /// Sets the style of the segment + /// + /// Accepts either `Color` or `Style`. pub fn set_style(&mut self, style: T) -> &mut Segment where T: Into