|
1 | 1 | use std::fmt;
|
2 | 2 |
|
3 |
| -use crate::{ident::Ident, Docs, Include, Interface, Render, RenderOpts, StandaloneFunc}; |
| 3 | +use crate::{ident::Ident, Docs, Include, Interface, Render, RenderOpts, StandaloneFunc, Use}; |
4 | 4 |
|
5 | 5 | #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
6 | 6 | pub struct World {
|
@@ -55,6 +55,9 @@ impl World {
|
55 | 55 | pub fn include(&mut self, include: Include) {
|
56 | 56 | self.item(WorldItem::Include(include));
|
57 | 57 | }
|
| 58 | + pub fn use_(&mut self, use_: Use) { |
| 59 | + self.item(WorldItem::Use(use_)); |
| 60 | + } |
58 | 61 |
|
59 | 62 | /// Set the documentation
|
60 | 63 | pub fn docs(&mut self, docs: Option<impl Into<Docs>>) {
|
@@ -143,6 +146,7 @@ impl Render for World {
|
143 | 146 | render_function(f, opts, function)?;
|
144 | 147 | }
|
145 | 148 | WorldItem::Include(include) => include.render(f, opts)?,
|
| 149 | + WorldItem::Use(use_) => use_.render(f, opts)?, |
146 | 150 | }
|
147 | 151 | }
|
148 | 152 | let opts = &opts.outdent();
|
@@ -173,6 +177,9 @@ pub enum WorldItem {
|
173 | 177 |
|
174 | 178 | /// Include type
|
175 | 179 | Include(Include),
|
| 180 | + |
| 181 | + /// Use |
| 182 | + Use(Use), |
176 | 183 | }
|
177 | 184 |
|
178 | 185 | impl WorldItem {
|
|
0 commit comments