File tree Expand file tree Collapse file tree 3 files changed +3
-7
lines changed
kernel/src/net/socket/unix Expand file tree Collapse file tree 3 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -74,11 +74,7 @@ impl AbsHandleMap {
74
74
///
75
75
/// 分配到的可用的抽象端点
76
76
pub fn alloc ( & self , name : String ) -> Option < Endpoint > {
77
- let abs_addr = match ABS_ADDRESS_ALLOCATOR . lock ( ) . alloc ( ) {
78
- Some ( addr) => addr,
79
- //地址被分配
80
- None => return None ,
81
- } ;
77
+ let abs_addr = ABS_ADDRESS_ALLOCATOR . lock ( ) . alloc ( ) ?;
82
78
83
79
let result = Some ( Endpoint :: Abspath ( ( AbsHandle :: new ( abs_addr) , name) ) ) ;
84
80
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ impl Listener {
126
126
}
127
127
128
128
pub ( super ) fn is_acceptable ( & self ) -> bool {
129
- return self . incoming_conns . lock ( ) . len ( ) != 0 ;
129
+ ! self . incoming_conns . lock ( ) . is_empty ( )
130
130
}
131
131
}
132
132
Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ impl Listener {
228
228
}
229
229
230
230
pub ( super ) fn is_acceptable ( & self ) -> bool {
231
- return self . incoming_connects . lock ( ) . len ( ) != 0 ;
231
+ ! self . incoming_connects . lock ( ) . is_empty ( )
232
232
}
233
233
234
234
pub ( super ) fn try_accept ( & self ) -> Result < ( Arc < SocketInode > , Endpoint ) , SystemError > {
You can’t perform that action at this time.
0 commit comments