You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: ballista/core/src/config.rs
+6-7
Original file line number
Diff line number
Diff line change
@@ -116,15 +116,14 @@ impl BallistaConfig {
116
116
for(name, entry)in&supported_entries {
117
117
ifletSome(v) = settings.get(name){
118
118
// validate that we can parse the user-supplied value
119
-
Self::parse_value(v.as_str(), entry._data_type.clone()).map_err(|e| BallistaError::General(format!("Failed to parse user-supplied value '{}' for configuration setting '{}': {}", name, v, e)))?;
119
+
Self::parse_value(v.as_str(), entry._data_type.clone()).map_err(|e| BallistaError::General(format!("Failed to parse user-supplied value '{name}' for configuration setting '{v}': {e}")))?;
120
120
}elseifletSome(v) = entry.default_value.clone(){
121
-
Self::parse_value(v.as_str(), entry._data_type.clone()).map_err(|e| BallistaError::General(format!("Failed to parse default value '{}' for configuration setting '{}': {}", name, v, e)))?;
121
+
Self::parse_value(v.as_str(), entry._data_type.clone()).map_err(|e| BallistaError::General(format!("Failed to parse default value '{name}' for configuration setting '{v}': {e}")))?;
122
122
}elseif entry.default_value.is_none(){
123
123
// optional config
124
124
}else{
125
125
returnErr(BallistaError::General(format!(
126
-
"No value specified for mandatory configuration setting '{}'",
127
-
name
126
+
"No value specified for mandatory configuration setting '{name}'"
128
127
)));
129
128
}
130
129
}
@@ -137,18 +136,18 @@ impl BallistaConfig {
137
136
DataType::UInt16 => {
138
137
val.to_string()
139
138
.parse::<usize>()
140
-
.map_err(|e| format!("{:?}", e))?;
139
+
.map_err(|e| format!("{e:?}"))?;
141
140
}
142
141
DataType::Boolean => {
143
142
val.to_string()
144
143
.parse::<bool>()
145
-
.map_err(|e| format!("{:?}", e))?;
144
+
.map_err(|e| format!("{e:?}"))?;
146
145
}
147
146
DataType::Utf8 => {
148
147
val.to_string();
149
148
}
150
149
_ => {
151
-
returnErr(format!("not support data type: {}", data_type));
150
+
returnErr(format!("not support data type: {data_type}"));
0 commit comments