Skip to content

Commit bc56502

Browse files
committed
moved Module implementation to front/mod.rs
1 parent d1ff1a1 commit bc56502

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

naga/src/front/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
Frontend parsers that consume binary and text shaders and load them into [`Module`](super::Module)s.
2+
Frontend parsers that consume binary and text shaders and load them into [`Module`]s.
33
*/
44

55
mod interpolator;
@@ -328,3 +328,12 @@ impl<Name: fmt::Debug, Var: fmt::Debug> fmt::Debug for SymbolTable<Name, Var> {
328328
.finish()
329329
}
330330
}
331+
332+
use crate::{Comments, Module};
333+
334+
impl Module {
335+
pub fn get_comments_or_insert_default(&mut self) -> &mut Box<Comments> {
336+
self.comments
337+
.get_or_insert_with(|| Box::new(Comments::default()))
338+
}
339+
}

naga/src/lib.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2501,10 +2501,3 @@ pub struct Module {
25012501
/// Comments, usually serving as documentation
25022502
pub comments: Option<Box<Comments>>,
25032503
}
2504-
2505-
impl Module {
2506-
pub fn get_comments_or_insert_default(&mut self) -> &mut Box<Comments> {
2507-
self.comments
2508-
.get_or_insert_with(|| Box::new(Comments::default()))
2509-
}
2510-
}

0 commit comments

Comments
 (0)