1
Fork 0
mirror of https://github.com/RGBCube/embd-rs synced 2025-07-27 05:27:44 +00:00

Add lifetime annotations

This commit is contained in:
RGBCube 2024-01-05 11:41:22 +03:00
parent e034144ab6
commit e3611073b5
No known key found for this signature in database

View file

@ -104,12 +104,12 @@ pub struct Dir {
impl Dir { impl Dir {
/// Returns the children of the directory. /// Returns the children of the directory.
pub fn children(&self) -> &[DirEntry] { pub fn children(&self) -> &'static [DirEntry] {
&self.__children &self.__children
} }
/// Returns the absolute path of the directory. /// 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()) Path::new(self.__path.as_ref().into())
} }
@ -140,12 +140,12 @@ pub struct File {
impl File { impl File {
/// Returns the content of the file. /// Returns the content of the file.
pub fn content(&self) -> &[u8] { pub fn content(&self) -> &'static [u8] {
&self.__content &self.__content
} }
/// Returns the absolute path of the file. /// 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()) Path::new(self.__path.as_ref().into())
} }
} }