mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-03 03:42:26 +01:00
fix some clippy warnings
This commit is contained in:
11
src/input.rs
11
src/input.rs
@@ -137,17 +137,12 @@ impl<'a> Input<'a> {
|
||||
}
|
||||
|
||||
pub fn is_stdin(&self) -> bool {
|
||||
if let InputKind::StdIn = self.kind {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
matches!(self.kind, InputKind::StdIn)
|
||||
}
|
||||
|
||||
pub fn with_name(mut self, provided_name: Option<&OsStr>) -> Self {
|
||||
match provided_name {
|
||||
Some(name) => self.description.name = name.to_string_lossy().to_string(),
|
||||
None => {}
|
||||
if let Some(name) = provided_name {
|
||||
self.description.name = name.to_string_lossy().to_string()
|
||||
}
|
||||
|
||||
self.metadata.user_provided_name = provided_name.map(|n| n.to_owned());
|
||||
|
Reference in New Issue
Block a user