Deprecate relative asset paths, better warnings for asset!() (#3214)
* Deprecate relative asset paths * fix paths, better warnings in asset parser
This commit is contained in:
1 parent
8a2922c663
commit
ba4389567d
13 files changed
+95
-36
No files matched your search
@@ -22,6 +22,16 @@ impl Asset {
|
||||
self
|
||||
}
|
||||
|
||||
/// Create a new asset but with a relative path
|
||||
///
|
||||
/// This method is deprecated and will be removed in a future release.
|
||||
#[deprecated(
|
||||
note = "Relative asset!() paths are not supported. Use a path like `/assets/myfile.png` instead of `./assets/myfile.png`"
|
||||
)]
|
||||
pub const fn new_relative(self) -> Self {
|
||||
self
|
||||
}
|
||||
|
||||
/// Get the path to the asset
|
||||
pub fn path(&self) -> PathBuf {
|
||||
PathBuf::from(self.input.to_string())
|
||||
|
||||
Reference in new issue
Block a user