szaszm commented on code in PR #2220:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2220#discussion_r3785046576
##########
minifi_rust/extensions/minifi_rs_playground/src/processors/generate_flow_file/properties.rs:
##########
@@ -15,64 +15,34 @@
// specific language governing permissions and limitations
// under the License.
-use minifi_native::{Property, StandardPropertyValidator};
+use super::DataFormat;
+use minifi_native::{DataSize, Property};
-pub(crate) const FILE_SIZE: Property = Property {
- name: "File Size",
- description: "The size of the file that will be used",
- is_required: true,
- is_sensitive: false,
- supports_expr_lang: true,
- default_value: Some("1 kB"),
- validator: StandardPropertyValidator::DataSizeValidator,
- allowed_values: &[],
- allowed_type: None,
-};
+pub(crate) const FILE_SIZE: Property<DataSize> =
+ Property::new("File Size", "The size of the file that will be used")
+ .supports_expression_language()
+ .with_default("1 kB");
-pub(crate) const BATCH_SIZE: Property = Property {
- name: "Batch Size",
- description: "The number of FlowFiles to be transferred in each
invocation",
- is_required: true,
- is_sensitive: false,
- supports_expr_lang: false,
- default_value: Some("1"),
- validator: StandardPropertyValidator::U64Validator,
- allowed_values: &[],
- allowed_type: None,
-};
+pub(crate) const BATCH_SIZE: Property<u64> = Property::new(
+ "Batch Size",
+ "The number of FlowFiles to be transferred in each invocation",
+)
+.with_default("1");
Review Comment:
It's one thing to put it on its own line, and I have nothing against that.
It's another thing how you indent it, and here a statement continuation doesn't
get indented as a continuation. Maybe splitting the call within the parentheses
to multiple lines caused the formatter to end up undoing the continuation
indentation for further lines. I believe this is a problem with the formatter,
but I didn't find any clear confirmation of that in the rules.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]