Skip to content

Commit

Permalink
chore: fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
alixinne committed Jul 23, 2024
1 parent 23a3c9b commit 36d520d
Showing 1 changed file with 31 additions and 35 deletions.
66 changes: 31 additions & 35 deletions lang-pp/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,42 +208,38 @@ impl<'r> ProcessorStateBuilder<'r> {
pub fn finish(self) -> ProcessorState {
let one = DefineObject::one();

let mut state = ProcessorState {
// No #include extensions enabled
include_mode: IncludeMode::None,
// Spec 3.3, "There is a built-in macro definition for each profile the implementation
// supports. All implementations provide the following macro:
// `#define GL_core_profile 1`
definitions: self
.core_profile
.then(|| Define::object("GL_core_profile".into(), one.clone(), true))
.into_iter()
.chain(
self.compatibility_profile
.then(|| {
Define::object("GL_compatibility_profile".into(), one.clone(), true)
})
.into_iter(),
)
.chain(
self.es_profile
.then(|| Define::object("GL_es_profile".into(), one.clone(), true))
.into_iter(),
)
.chain(self.definitions.into_iter())
.map(|definition| Definition::Regular(definition.into(), FileId::default()))
.chain([Definition::Line, Definition::File, Definition::Version].into_iter())
.chain(self.registry.all().map(|spec| {
Definition::Regular(
Define::object(spec.name().as_ref().into(), one.clone(), true).into(),
FileId::default(),
let mut state =
ProcessorState {
// No #include extensions enabled
include_mode: IncludeMode::None,
// Spec 3.3, "There is a built-in macro definition for each profile the implementation
// supports. All implementations provide the following macro:
// `#define GL_core_profile 1`
definitions: self
.core_profile
.then(|| Define::object("GL_core_profile".into(), one.clone(), true))
.into_iter()
.chain(self.compatibility_profile.then(|| {
Define::object("GL_compatibility_profile".into(), one.clone(), true)
}))
.chain(
self.es_profile
.then(|| Define::object("GL_es_profile".into(), one.clone(), true)),
)
}))
.map(|definition| (definition.name().into(), definition))
.collect(),
version: Version::default(),
cpp_style_line: false,
};
.chain(self.definitions)
.map(|definition| Definition::Regular(definition.into(), FileId::default()))
.chain([Definition::Line, Definition::File, Definition::Version])
.chain(self.registry.all().map(|spec| {
Definition::Regular(
Define::object(spec.name().as_ref().into(), one.clone(), true).into(),
FileId::default(),
)
}))
.map(|definition| (definition.name().into(), definition))
.collect(),
version: Version::default(),
cpp_style_line: false,
};

for (name, behavior) in self.extensions {
state.add_extension(&name, behavior);
Expand Down

0 comments on commit 36d520d

Please sign in to comment.