Skip to content

Commit 91d9bfd

Browse files
committed
fmt, clippy
1 parent ee4fd40 commit 91d9bfd

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

phper/src/classes.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ impl<T: 'static> ClassEntity<T> {
574574
/// let mut bar = ClassEntity::new("Bar");
575575
/// bar.extends(&foo);
576576
///
577-
/// module
577+
/// module
578578
/// }
579579
/// ```
580580
pub fn extends<U: 'static>(&mut self, parent: &StateClass<U>) {
@@ -586,8 +586,8 @@ impl<T: 'static> ClassEntity<T> {
586586
}));
587587
}
588588

589-
/// Register class to `extends` the parent class, by name. Similar to `extends`, this is
590-
/// useful for built-ins.
589+
/// Register class to `extends` the parent class, by name. Similar to
590+
/// `extends`, this is useful for built-ins.
591591
///
592592
/// # Examples
593593
///
@@ -854,7 +854,8 @@ impl InterfaceEntity {
854854
/// ```
855855
pub fn extends(&mut self, interface: Interface) {
856856
self.extends.push(Box::new(move || {
857-
let entry: &'static ClassEntry = unsafe { std::mem::transmute(interface.as_class_entry()) };
857+
let entry: &'static ClassEntry =
858+
unsafe { std::mem::transmute(interface.as_class_entry()) };
858859
entry
859860
}));
860861
}

tests/integration/src/classes.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
use phper::{
1212
alloc::RefClone,
13-
classes::{
14-
ClassEntity, ClassEntry, Interface, InterfaceEntity, StateClass, Visibility,
15-
},
13+
classes::{ClassEntity, ClassEntry, Interface, InterfaceEntity, StateClass, Visibility},
1614
functions::{Argument, ReturnType},
1715
modules::Module,
1816
types::{ArgumentTypeHint, ReturnTypeHint},
@@ -22,11 +20,11 @@ use std::{collections::HashMap, convert::Infallible};
2220

2321
pub fn integrate(module: &mut Module) {
2422
integrate_a(module);
25-
let foo = integrate_foo(module);
23+
let foo_class = integrate_foo(module);
2624
integrate_i_bar(module);
2725
integrate_static_props(module);
2826
integrate_i_constants(module);
29-
integrate_bar_extends_foo(module, &foo);
27+
integrate_bar_extends_foo(module, &foo_class);
3028
#[cfg(phper_major_version = "8")]
3129
integrate_stringable(module);
3230
}
@@ -224,12 +222,10 @@ fn integrate_static_props(module: &mut Module) {
224222
module.add_class(class);
225223
}
226224

227-
fn integrate_bar_extends_foo(module: &mut Module, foo: &StateClass<Foo>) {
225+
fn integrate_bar_extends_foo(module: &mut Module, foo_class: &StateClass<Foo>) {
228226
let mut cls = ClassEntity::new(r"IntegrationTest\BarExtendsFoo");
229-
cls.extends(foo);
230-
cls.add_method("test", Visibility::Public, |_,_| {
231-
phper::ok(())
232-
});
227+
cls.extends(foo_class);
228+
cls.add_method("test", Visibility::Public, |_, _| phper::ok(()));
233229
module.add_class(cls);
234230
}
235231

0 commit comments

Comments
 (0)