Description: Fix: Resolve temporary value lifetime error in app.rs
 TODO: The previous patch attempted to return a reference to a temporary 
MappedSlice. This secondary patch replace it with native direct slicing
 `&mmap[0..self.size]` to satisfy the Rust borrow checker.
 .
 dz6 (0.7.0-1) unstable; urgency=medium
 .
   * Initial release to Debian Mentors.
Author: Danielly <danielly@mentebinaria.com.br>

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2026-06-19

--- dz6-0.7.0.orig/target/release/.fingerprint/dz6-32424271d1d79588/output-bin-dz6
+++ dz6-0.7.0/target/release/.fingerprint/dz6-32424271d1d79588/output-bin-dz6
@@ -1,3 +1,3 @@
-{"$message_type":"diagnostic","message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.\n\nErroneous code examples:\n\n```compile_fail,E0308\nfn plus_one(x: i32) -> i32 {\n    x + 1\n}\n\nplus_one(\"Not a number\");\n//       ^^^^^^^^^^^^^^ expected `i32`, found `&str`\n\nif \"Not a bool\" {\n// ^^^^^^^^^^^^ expected `bool`, found `&str`\n}\n\nlet x: f32 = \"Not a float\";\n//     ---   ^^^^^^^^^^^^^ expected `f32`, found `&str`\n//     |\n//     expected due to this\n```\n\nThis error occurs when an expression was used in a place where the compiler\nexpected an expression of a different type. It can occur in several cases, the\nmost common being when calling a function and passing an argument which has a\ndifferent type than the matching type in the function declaration.\n"},"level":"error","spans":[{"file_name":"src/app.rs","byte_start":1120,"byte_end":1163,"line_start":41,"line_end":41,"column_start":20,"column_end":63,"is_primary":true,"text":[{"text":"            return mmap.as_slice(0, self.size as u64).unwrap();","highlight_start":20,"highlight_end":63}],"label":"expected `&[u8]`, found `MappedSlice<'_>`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/app.rs","byte_start":1044,"byte_end":1049,"line_start":39,"line_end":39,"column_start":37,"column_end":42,"is_primary":false,"text":[{"text":"    pub fn get_buffer(&mut self) -> &[u8] {","highlight_start":37,"highlight_end":42}],"label":"expected `&[u8]` because of return type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider borrowing here","code":null,"level":"help","spans":[{"file_name":"src/app.rs","byte_start":1120,"byte_end":1120,"line_start":41,"line_end":41,"column_start":20,"column_end":20,"is_primary":true,"text":[{"text":"            return mmap.as_slice(0, self.size as u64).unwrap();","highlight_start":20,"highlight_end":20}],"label":null,"suggested_replacement":"&","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[1m\u001b[91merror[E0308]\u001b[0m\u001b[1m: mismatched types\u001b[0m\n  \u001b[1m\u001b[94m--> \u001b[0msrc/app.rs:41:20\n   \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m39\u001b[0m \u001b[1m\u001b[94m|\u001b[0m     pub fn get_buffer(&mut self) -> &[u8] {\n   \u001b[1m\u001b[94m|\u001b[0m                                     \u001b[1m\u001b[94m-----\u001b[0m \u001b[1m\u001b[94mexpected `&[u8]` because of return type\u001b[0m\n\u001b[1m\u001b[94m40\u001b[0m \u001b[1m\u001b[94m|\u001b[0m         if let Some(mmap) = self.mmap.as_mut() {\n\u001b[1m\u001b[94m41\u001b[0m \u001b[1m\u001b[94m|\u001b[0m             return mmap.as_slice(0, self.size as u64).unwrap();\n   \u001b[1m\u001b[94m|\u001b[0m                    \u001b[1m\u001b[91m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m \u001b[1m\u001b[91mexpected `&[u8]`, found `MappedSlice<'_>`\u001b[0m\n   \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[96mhelp\u001b[0m: consider borrowing here\n   \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m41\u001b[0m \u001b[1m\u001b[94m| \u001b[0m            return \u001b[92m&\u001b[0mmmap.as_slice(0, self.size as u64).unwrap();\n   \u001b[1m\u001b[94m|\u001b[0m                    \u001b[92m+\u001b[0m\n\n"}
+{"$message_type":"diagnostic","message":"cannot return reference to temporary value","code":{"code":"E0515","explanation":"A reference to a local variable was returned.\n\nErroneous code example:\n\n```compile_fail,E0515\nfn get_dangling_reference() -> &'static i32 {\n    let x = 0;\n    &x\n}\n```\n\n```compile_fail,E0515\nuse std::slice::Iter;\nfn get_dangling_iterator<'a>() -> Iter<'a, i32> {\n    let v = vec![1, 2, 3];\n    v.iter()\n}\n```\n\nLocal variables, function parameters and temporaries are all dropped before\nthe end of the function body. A returned reference (or struct containing a\nreference) to such a dropped value would immediately be invalid. Therefore\nit is not allowed to return such a reference.\n\nConsider returning a value that takes ownership of local data instead of\nreferencing it:\n\n```\nuse std::vec::IntoIter;\n\nfn get_integer() -> i32 {\n    let x = 0;\n    x\n}\n\nfn get_owned_iterator() -> IntoIter<i32> {\n    let v = vec![1, 2, 3];\n    v.into_iter()\n}\n```\n"},"level":"error","spans":[{"file_name":"src/app.rs","byte_start":1120,"byte_end":1164,"line_start":41,"line_end":41,"column_start":20,"column_end":64,"is_primary":true,"text":[{"text":"            return &mmap.as_slice(0, self.size as u64).unwrap();","highlight_start":20,"highlight_end":64}],"label":"returns a reference to data owned by the current function","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/app.rs","byte_start":1121,"byte_end":1164,"line_start":41,"line_end":41,"column_start":21,"column_end":64,"is_primary":false,"text":[{"text":"            return &mmap.as_slice(0, self.size as u64).unwrap();","highlight_start":21,"highlight_end":64}],"label":"temporary value created here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[1m\u001b[91merror[E0515]\u001b[0m\u001b[1m: cannot return reference to temporary value\u001b[0m\n  \u001b[1m\u001b[94m--> \u001b[0msrc/app.rs:41:20\n   \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m41\u001b[0m \u001b[1m\u001b[94m|\u001b[0m             return &mmap.as_slice(0, self.size as u64).unwrap();\n   \u001b[1m\u001b[94m|\u001b[0m                    \u001b[1m\u001b[91m^\u001b[0m\u001b[1m\u001b[94m-------------------------------------------\u001b[0m\n   \u001b[1m\u001b[94m|\u001b[0m                    \u001b[1m\u001b[91m|\u001b[0m\u001b[1m\u001b[94m|\u001b[0m\n   \u001b[1m\u001b[94m|\u001b[0m                    \u001b[1m\u001b[91m|\u001b[0m\u001b[1m\u001b[94mtemporary value created here\u001b[0m\n   \u001b[1m\u001b[94m|\u001b[0m                    \u001b[1m\u001b[91mreturns a reference to data owned by the current function\u001b[0m\n\n"}
 {"$message_type":"diagnostic","message":"aborting due to 1 previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[1m\u001b[91merror\u001b[0m\u001b[1m: aborting due to 1 previous error\u001b[0m\n\n"}
-{"$message_type":"diagnostic","message":"For more information about this error, try `rustc --explain E0308`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[1mFor more information about this error, try `rustc --explain E0308`.\u001b[0m\n"}
+{"$message_type":"diagnostic","message":"For more information about this error, try `rustc --explain E0515`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[1mFor more information about this error, try `rustc --explain E0515`.\u001b[0m\n"}
