8000 style: cargp fmt · RustPython/RustPython@ef8d3b1 · GitHub
[go: up one dir, main page]

Skip to content

Commit ef8d3b1

Browse files
committed
style: cargp fmt
1 parent a79528a commit ef8d3b1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

vm/src/builtins/type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub struct PyType {
5050
#[cfg(feature = "gc")]
5151
impl crate::object::gc::GcTrace for PyType {
5252
fn trace(&self, tracer_fn: &mut crate::object::gc::TracerFn) {
53-
// FIXME(discord9): figure out correct trace() for PyType,
53+
// FIXME(discord9): figure out correct trace() for PyType,
5454
// simply call each field results in underflow of rc, is PyType all leaked()?
5555
// might have to do with similiar problem before which only use PyInner<Erased>(through `.as_object()`) can access header() with correct data
5656
// but PyInner<T> access header() with wrong data, but not sure about that.

vm/src/object/gc/collector_sync.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ unsafe fn free(ptr: ObjPtr) {
7777
impl CcSync {
7878
/// _suggest_(may or may not) collector to collect garbage. return number of cyclic garbage being collected
7979
#[inline]
80-
pub fn gc(&self)->usize {
80+
pub fn gc(&self) -> usize {
8181
if self.should_gc() {
8282
self.force_gc()
83-
}else {
83+
} else {
8484
0
8585
}
8686
}
8787
#[inline]
88-
pub fn force_gc(&self)->usize{
88+
pub fn force_gc(&self) -> usize {
8989
self.collect_cycles()
9090
}
9191
fn roots_len(&self) -> usize {
@@ -96,7 +96,7 @@ impl CcSync {
9696
self.roots_len() > 100
9797
}
9898
pub fn increment(&self, obj: ObjRef) {
99-
if obj.header().is_leaked(){
99+
if obj.header().is_leaked() {
100100
// by define a leaked object's rc should not change?
101101
return;
102102
}
@@ -159,7 +159,7 @@ impl CcSync {
159159
}
160160
}
161161

162-
fn collect_cycles(&self) ->usize{
162+
fn collect_cycles(&self) -> usize {
163163
if IS_GC_THREAD.with(|v| v.get()) {
164164
return 0;
165165
// already call collect_cycle() once
@@ -218,7 +218,7 @@ impl CcSync {
218218
})
219219
.count();
220220
}
221-
fn collect_roots(&self, lock: MutexGuard<()>) ->usize {
221+
fn collect_roots(&self, lock: MutexGuard<()>) -> usize {
222222
// Collecting the nodes into this Vec is difference from the original
223223
// Bacon-Rajan paper. We need this because we have destructors(RAII) and
224224
// running them during traversal will cause cycles to be broken which

0 commit comments

Comments
 (0)
0