File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ use crate::value::Value;
19
19
/// [loadable by Lua]: https://www.lua.org/manual/5.4/manual.html#3.3.2
20
20
pub trait AsChunk < ' a > {
21
21
/// Returns optional chunk name
22
+ ///
23
+ /// See [`Chunk::set_name`] for possible name prefixes.
22
24
fn name ( & self ) -> Option < StdString > {
23
25
None
24
26
}
@@ -306,6 +308,11 @@ impl Compiler {
306
308
307
309
impl Chunk < ' _ > {
308
310
/// Sets the name of this chunk, which results in more informative error traces.
311
+ ///
312
+ /// Possible name prefixes:
313
+ /// - `@` - file path (when truncation is needed, the end of the file path is kept, as this is
314
+ /// more useful for identifying the file)
315
+ /// - `=` - custom chunk name (when truncation is needed, the beginning of the name is kept)
309
316
pub fn set_name ( mut self , name : impl Into < String > ) -> Self {
310
317
self . name = name. into ( ) ;
311
318
self
You can’t perform that action at this time.
0 commit comments