From e3611073b5670ccea035cd502a575f588c5aa3e4 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Fri, 5 Jan 2024 11:41:22 +0300 Subject: [PATCH] Add lifetime annotations --- embed/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/embed/src/lib.rs b/embed/src/lib.rs index 4545e00..98610cf 100644 --- a/embed/src/lib.rs +++ b/embed/src/lib.rs @@ -104,12 +104,12 @@ pub struct Dir { impl Dir { /// Returns the children of the directory. - pub fn children(&self) -> &[DirEntry] { + pub fn children(&self) -> &'static [DirEntry] { &self.__children } /// Returns the absolute path of the directory. - pub fn path(&self) -> &Path { + pub fn path(&self) -> &'static Path { Path::new(self.__path.as_ref().into()) } @@ -140,12 +140,12 @@ pub struct File { impl File { /// Returns the content of the file. - pub fn content(&self) -> &[u8] { + pub fn content(&self) -> &'static [u8] { &self.__content } /// Returns the absolute path of the file. - pub fn path(&self) -> &Path { + pub fn path(&self) -> &'static Path { Path::new(self.__path.as_ref().into()) } }