1
Fork 0
mirror of https://github.com/RGBCube/embd-rs synced 2025-07-26 13:07:47 +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 {
/// 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())
}
}