Skip to content

Commit f0a4027

Browse files
Improve code style
1 parent 9fae8a6 commit f0a4027

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

crates/stackable-operator/src/v2/flask_config_writer.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ impl PythonType {
7878
&& value
7979
.chars()
8080
.next()
81-
.filter(|c| !c.is_ascii_digit())
82-
.is_some()
81+
.as_ref()
82+
.is_some_and(|c| !c.is_ascii_digit())
8383
{
8484
Ok(value.to_string())
8585
} else {
@@ -141,8 +141,7 @@ where
141141
// If an option cannot be mapped to a Python type then it is a config override and treated
142142
// as Python expression.
143143
let content = O::from_str(name)
144-
.map(|option| option.python_type())
145-
.unwrap_or(PythonType::Expression)
144+
.map_or(PythonType::Expression, |option| option.python_type())
146145
.convert_to_python(value)?;
147146

148147
writeln!(writer, "{variable} = {content}").context(WriteConfigSnafu)?;

0 commit comments

Comments
 (0)