aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony/console/completion/suggestion.rs
blob: a7db5c390e994289b6a7fc55247d3464f1f469ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! ref: composer/vendor/symfony/console/Completion/Suggestion.php

/// Represents a single suggested value.
#[derive(Debug)]
pub struct Suggestion {
    value: String,
}

impl Suggestion {
    pub fn new(value: String) -> Self {
        Self { value }
    }

    pub fn get_value(&self) -> String {
        self.value.clone()
    }
}

impl std::fmt::Display for Suggestion {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}", self.get_value())
    }
}