Copilot commented on code in PR #2220:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2220#discussion_r3646721111


##########
minifi_rust/minifi_native/src/api/processor_wrappers/flow_file_transform.rs:
##########
@@ -67,6 +67,19 @@ impl<'a> TransformedFlowFile<'a> {
     pub fn attributes_to_add(&self) -> &HashMap<String, String> {
         &self.attributes_to_add
     }
+
+    #[cfg(any(test, feature = "test-utils"))]
+    pub fn into_bytes(self) -> std::io::Result<Option<Vec<u8>>> {
+        match self.new_content {
+            Some(Content::Buffer(vec)) => Ok(Some(vec)),
+            Some(Content::Stream(mut stream)) => {
+                let mut buffer = Vec::new();
+                stream.read_to_end(&mut buffer)?;
+                Ok(Some(buffer))

Review Comment:
   `read_to_end` is a `std::io::Read` trait method, but `Read` is not imported 
in this module. This will fail to compile when `cfg(test)`/`test-utils` enables 
`into_bytes`.



-- 
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]

Reply via email to