Another batch of lint fixes (#36521)
- **Enable a bunch of extra lints** - **First batch of fixes** - **More fixes** Release Notes: - N/A
This commit is contained in:
parent
69b1c6d6f5
commit
6825715503
147 changed files with 788 additions and 1042 deletions
|
@ -194,15 +194,11 @@ impl HeadlessProject {
|
|||
languages.clone(),
|
||||
);
|
||||
|
||||
cx.subscribe(
|
||||
&buffer_store,
|
||||
|_this, _buffer_store, event, cx| match event {
|
||||
BufferStoreEvent::BufferAdded(buffer) => {
|
||||
cx.subscribe(buffer, Self::on_buffer_event).detach();
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
)
|
||||
cx.subscribe(&buffer_store, |_this, _buffer_store, event, cx| {
|
||||
if let BufferStoreEvent::BufferAdded(buffer) = event {
|
||||
cx.subscribe(buffer, Self::on_buffer_event).detach();
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
|
||||
let extensions = HeadlessExtensionStore::new(
|
||||
|
@ -285,18 +281,17 @@ impl HeadlessProject {
|
|||
event: &BufferEvent,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
match event {
|
||||
BufferEvent::Operation {
|
||||
operation,
|
||||
is_local: true,
|
||||
} => cx
|
||||
.background_spawn(self.session.request(proto::UpdateBuffer {
|
||||
project_id: SSH_PROJECT_ID,
|
||||
buffer_id: buffer.read(cx).remote_id().to_proto(),
|
||||
operations: vec![serialize_operation(operation)],
|
||||
}))
|
||||
.detach(),
|
||||
_ => {}
|
||||
if let BufferEvent::Operation {
|
||||
operation,
|
||||
is_local: true,
|
||||
} = event
|
||||
{
|
||||
cx.background_spawn(self.session.request(proto::UpdateBuffer {
|
||||
project_id: SSH_PROJECT_ID,
|
||||
buffer_id: buffer.read(cx).remote_id().to_proto(),
|
||||
operations: vec![serialize_operation(operation)],
|
||||
}))
|
||||
.detach()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -334,7 +334,7 @@ fn start_server(
|
|||
let (mut stdin_msg_tx, mut stdin_msg_rx) = mpsc::unbounded::<Envelope>();
|
||||
cx.background_spawn(async move {
|
||||
while let Ok(msg) = read_message(&mut stdin_stream, &mut input_buffer).await {
|
||||
if let Err(_) = stdin_msg_tx.send(msg).await {
|
||||
if (stdin_msg_tx.send(msg).await).is_err() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -891,7 +891,8 @@ pub fn handle_settings_file_changes(
|
|||
|
||||
fn read_proxy_settings(cx: &mut Context<HeadlessProject>) -> Option<Url> {
|
||||
let proxy_str = ProxySettings::get_global(cx).proxy.to_owned();
|
||||
let proxy_url = proxy_str
|
||||
|
||||
proxy_str
|
||||
.as_ref()
|
||||
.and_then(|input: &String| {
|
||||
input
|
||||
|
@ -899,8 +900,7 @@ fn read_proxy_settings(cx: &mut Context<HeadlessProject>) -> Option<Url> {
|
|||
.inspect_err(|e| log::error!("Error parsing proxy settings: {}", e))
|
||||
.ok()
|
||||
})
|
||||
.or_else(read_proxy_from_env);
|
||||
proxy_url
|
||||
.or_else(read_proxy_from_env)
|
||||
}
|
||||
|
||||
fn daemonize() -> Result<ControlFlow<()>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue