Uprev Rust toolchain pins to 1.95.0 (#24684)

## Summary
- Bump the workspace Rust toolchain from `1.93.0` to `1.95.0` across
Cargo, Bazel, CI, release workflows, devcontainers, and the Codex
environment config.
- Refresh `MODULE.bazel.lock` so the Bazel Rust toolchain artifacts
match the new version.
- Leave purpose-specific toolchains unchanged, including the
`argument-comment-lint` nightly and the upstream `rusty_v8` `1.91.0`
build pin.
- Includes fixes for new lints from `just fix` and a few codex-authored
fixes for lints without a suggestion.
This commit is contained in:
Adam Perry @ OpenAI
2026-05-26 20:59:47 -07:00
committed by GitHub
parent 64e340ad28
commit cca1e0ba1d
59 changed files with 230 additions and 260 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ jobs:
working-directory: codex-rs
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@a0b273b48ed29de4470960879e8381ff45632f26 # 1.93.0
- uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
- name: Install cargo-audit
uses: taiki-e/install-action@v2
with:
+8 -16
View File
@@ -948,10 +948,8 @@ impl ScanState {
'(' => self.depth.paren += 1,
')' => self.depth.paren = (self.depth.paren - 1).max(0),
'<' => self.depth.angle += 1,
'>' => {
if self.depth.angle > 0 {
self.depth.angle -= 1;
}
'>' if self.depth.angle > 0 => {
self.depth.angle -= 1;
}
_ => {}
}
@@ -2212,20 +2210,14 @@ mod tests {
continue;
}
match ch {
'\\' => {
if in_single || in_double {
escape = true;
}
'\\' if (in_single || in_double) => {
escape = true;
}
'\'' => {
if !in_double {
in_single = !in_single;
}
'\'' if !in_double => {
in_single = !in_single;
}
'"' => {
if !in_single {
in_double = !in_double;
}
'"' if !in_single => {
in_double = !in_double;
}
'{' if !in_single && !in_double => level_brace += 1,
'}' if !in_single && !in_double => level_brace -= 1,
@@ -196,7 +196,7 @@ fn canonicalize_json(value: &Value) -> Value {
}
Value::Object(map) => {
let mut entries: Vec<_> = map.iter().collect();
entries.sort_by(|(left, _), (right, _)| left.cmp(right));
entries.sort_by_key(|(key, _)| *key);
let mut sorted = Map::with_capacity(map.len());
for (key, child) in entries {
sorted.insert(key.clone(), canonicalize_json(child));
@@ -1390,14 +1390,13 @@ pub(super) async fn connect_remote_control_websocket(
status_publisher.publish_environment_id(/*environment_id*/ None);
}
tungstenite::Error::Http(response)
if matches!(response.status().as_u16(), 401 | 403) =>
if matches!(response.status().as_u16(), 401 | 403)
&& recover_remote_control_auth(auth_recovery, auth_change_rx).await =>
{
if recover_remote_control_auth(auth_recovery, auth_change_rx).await {
return Err(io::Error::other(format!(
"remote control websocket auth failed with HTTP {}; retrying after auth recovery",
response.status()
)));
}
return Err(io::Error::other(format!(
"remote control websocket auth failed with HTTP {}; retrying after auth recovery",
response.status()
)));
}
_ => {}
}
@@ -347,7 +347,7 @@ async fn run_websocket_inbound_loop<M, StreamError>(
incoming_message = websocket_reader.next() => {
match incoming_message {
Some(Ok(message)) => match message.into_incoming() {
Some(IncomingWebSocketMessage::Text(text)) => {
Some(IncomingWebSocketMessage::Text(text))
if !forward_incoming_message(
&transport_event_tx,
&writer_tx_for_reader,
@@ -355,10 +355,10 @@ async fn run_websocket_inbound_loop<M, StreamError>(
&text,
)
.await
{
break;
}
=> {
break;
}
Some(IncomingWebSocketMessage::Text(_)) => {}
Some(IncomingWebSocketMessage::Ping(payload)) => {
match writer_control_tx.try_send(M::pong(payload)) {
Ok(()) => {}
+2 -2
View File
@@ -456,8 +456,8 @@ impl OutgoingMessageSender {
) -> Vec<ServerRequest> {
let request_id_to_callback = self.request_id_to_callback.lock().await;
let mut requests = request_id_to_callback
.iter()
.filter_map(|(_, entry)| {
.values()
.filter_map(|entry| {
(entry.thread_id == Some(thread_id)).then_some(entry.request.clone())
})
.collect::<Vec<_>>();
@@ -758,12 +758,15 @@ pub(super) async fn read_response_and_notification_for_method(
JSONRPCMessage::Response(candidate) if candidate.id == target_id => {
response = Some(candidate);
}
JSONRPCMessage::Notification(candidate)
if candidate.method == method && notification.is_some() =>
{
bail!(
"received duplicate notification for method `{method}` before completing paired read"
);
}
JSONRPCMessage::Notification(candidate) if candidate.method == method => {
if notification.replace(candidate).is_some() {
bail!(
"received duplicate notification for method `{method}` before completing paired read"
);
}
notification = Some(candidate);
}
_ => {}
}
+1 -1
View File
@@ -776,7 +776,7 @@ fn compute_replacements(
}
}
replacements.sort_by(|(lhs_idx, _, _), (rhs_idx, _, _)| lhs_idx.cmp(rhs_idx));
replacements.sort_by_key(|(index, _, _)| *index);
Ok(replacements)
}
+1 -5
View File
@@ -2176,11 +2176,7 @@ struct RolloutStats {
impl RolloutStats {
fn average_bytes(&self) -> u64 {
if self.files == 0 {
0
} else {
self.total_bytes / self.files
}
self.total_bytes.checked_div(self.files).unwrap_or(0)
}
}
+3 -3
View File
@@ -537,7 +537,7 @@ async fn run_list(config_overrides: &CliConfigOverrides, list_args: ListArgs) ->
let effective_mcp_servers = mcp_manager.effective_servers(&config, /*auth*/ None).await;
let mut entries: Vec<_> = mcp_servers.iter().collect();
entries.sort_by(|(a, _), (b, _)| a.cmp(b));
entries.sort_by_key(|(name, _)| *name);
let auth_statuses = compute_auth_statuses(
effective_mcp_servers.iter(),
config.mcp_oauth_credentials_store_mode,
@@ -906,7 +906,7 @@ async fn run_get(config_overrides: &CliConfigOverrides, get_args: GetArgs) -> Re
let headers_display = match http_headers {
Some(map) if !map.is_empty() => {
let mut pairs: Vec<_> = map.iter().collect();
pairs.sort_by(|(a, _), (b, _)| a.cmp(b));
pairs.sort_by_key(|(name, _)| *name);
pairs
.into_iter()
.map(|(k, _)| format!("{k}=*****"))
@@ -919,7 +919,7 @@ async fn run_get(config_overrides: &CliConfigOverrides, get_args: GetArgs) -> Re
let env_headers_display = match env_http_headers {
Some(map) if !map.is_empty() => {
let mut pairs: Vec<_> = map.iter().collect();
pairs.sort_by(|(a, _), (b, _)| a.cmp(b));
pairs.sort_by_key(|(name, _)| *name);
pairs
.into_iter()
.map(|(k, var)| format!("{k}={var}"))
+1 -1
View File
@@ -649,7 +649,7 @@ fn render_json_schema_object(map: &serde_json::Map<String, JsonValue>) -> String
.unwrap_or_default();
let mut sorted_properties = properties.iter().collect::<Vec<_>>();
sorted_properties.sort_unstable_by(|(name_a, _), (name_b, _)| name_a.cmp(name_b));
sorted_properties.sort_unstable_by_key(|(name_a, _)| *name_a);
if sorted_properties
.iter()
.any(|(_, value)| has_property_description(value))
+7 -9
View File
@@ -477,15 +477,13 @@ impl ConfiguredCaBundle {
})?;
certificates.push(CertificateDer::from(cert_der.to_vec()));
}
SectionKind::Crl => {
if !logged_crl_presence {
info!(
source_env = self.source_env,
ca_path = %self.path.display(),
"ignoring X509 CRL entries found in custom CA bundle"
);
logged_crl_presence = true;
}
SectionKind::Crl if !logged_crl_presence => {
info!(
source_env = self.source_env,
ca_path = %self.path.display(),
"ignoring X509 CRL entries found in custom CA bundle"
);
logged_crl_presence = true;
}
_ => {}
}
+1 -1
View File
@@ -861,7 +861,7 @@ fn project_config_for_lookup_key(
.iter()
.filter(|(key, _)| normalize_project_lookup_key((*key).clone()) == lookup_key)
.collect();
normalized_matches.sort_by(|(left, _), (right, _)| left.cmp(right));
normalized_matches.sort_by_key(|(key, _)| *key);
normalized_matches
.first()
.map(|(_, project_config)| (**project_config).clone())
+1 -1
View File
@@ -1006,7 +1006,7 @@ fn project_trust_for_lookup_key(
.iter()
.filter(|(key, _)| normalize_project_trust_lookup_key((*key).clone()) == lookup_key)
.collect();
normalized_matches.sort_by(|(left, _), (right, _)| left.cmp(right));
normalized_matches.sort_by_key(|(key, _)| *key);
normalized_matches
.first()
.map(|(key, trust_level)| ((**key).clone(), **trust_level))
+2 -2
View File
@@ -230,7 +230,7 @@ fn serialize_mcp_server(config: &McpServerConfig) -> TomlItem {
let mut tools = TomlTable::new();
tools.set_implicit(false);
let mut tool_entries: Vec<_> = config.tools.iter().collect();
tool_entries.sort_by(|(left, _), (right, _)| left.cmp(right));
tool_entries.sort_by_key(|(name, _)| *name);
for (name, tool_config) in tool_entries {
let mut tool_entry = TomlTable::new();
tool_entry.set_implicit(false);
@@ -280,7 +280,7 @@ where
I: IntoIterator<Item = (&'a String, &'a String)>,
{
let mut entries: Vec<_> = pairs.into_iter().collect();
entries.sort_by(|(left, _), (right, _)| left.cmp(right));
entries.sort_by_key(|(key, _)| *key);
let mut table = TomlTable::new();
table.set_implicit(false);
for (key, value_str) in entries {
+1 -1
View File
@@ -99,7 +99,7 @@ pub fn canonicalize(value: &Value) -> Value {
Value::Array(items) => Value::Array(items.iter().map(canonicalize).collect()),
Value::Object(map) => {
let mut entries: Vec<_> = map.iter().collect();
entries.sort_by(|(left, _), (right, _)| left.cmp(right));
entries.sort_by_key(|(key, _)| *key);
let mut sorted = Map::with_capacity(map.len());
for (key, child) in entries {
sorted.insert(key.clone(), canonicalize(child));
+3 -3
View File
@@ -179,7 +179,7 @@ pub fn keymap_binding_clear_edit(context: &str, action: &str) -> ConfigEdit {
pub fn model_availability_nux_count_edits(shown_count: &HashMap<String, u32>) -> Vec<ConfigEdit> {
let mut shown_count_entries: Vec<_> = shown_count.iter().collect();
shown_count_entries.sort_unstable_by(|(left, _), (right, _)| left.cmp(right));
shown_count_entries.sort_unstable_by_key(|(left, _)| *left);
let mut edits = vec![ConfigEdit::ClearPath {
segments: vec!["tui".to_string(), "model_availability_nux".to_string()],
@@ -354,7 +354,7 @@ mod document_helpers {
if !config.tools.is_empty() {
let mut tools = new_implicit_table();
let mut tool_entries: Vec<_> = config.tools.iter().collect();
tool_entries.sort_by(|(left, _), (right, _)| left.cmp(right));
tool_entries.sort_by_key(|(name, _)| *name);
for (name, tool_config) in tool_entries {
tools.insert(name, serialize_mcp_server_tool(tool_config));
}
@@ -501,7 +501,7 @@ mod document_helpers {
I: IntoIterator<Item = (&'a String, &'a String)>,
{
let mut entries: Vec<_> = pairs.into_iter().collect();
entries.sort_by(|(a, _), (b, _)| a.cmp(b));
entries.sort_by_key(|(key, _)| *key);
let mut table = TomlTable::new();
table.set_implicit(false);
for (key, val) in entries {
@@ -170,7 +170,7 @@ fn render_tool_params(
.iter()
.filter(|(name, _)| !handled_names.contains(name.as_str()))
.collect::<Vec<_>>();
remaining_params.sort_by(|(left_name, _), (right_name, _)| left_name.cmp(right_name));
remaining_params.sort_by_key(|(name, _)| *name);
for (name, value) in remaining_params {
if handled_names.contains(name.as_str()) {
+1 -1
View File
@@ -30,7 +30,7 @@ use crate::unified_exec;
static TEST_MODEL_PRESETS: Lazy<Vec<ModelPreset>> = Lazy::new(|| {
let mut response = bundled_models_response()
.unwrap_or_else(|err| panic!("bundled models.json should parse: {err}"));
response.models.sort_by(|a, b| a.priority.cmp(&b.priority));
response.models.sort_by_key(|model| model.priority);
let mut presets: Vec<ModelPreset> = response.models.into_iter().map(Into::into).collect();
ModelPreset::mark_default_by_picker_visibility(&mut presets);
presets
@@ -105,7 +105,7 @@ pub(crate) fn build_wait_agent_statuses(
status: status.clone(),
})
.collect::<Vec<_>>();
extras.sort_by(|left, right| left.thread_id.to_string().cmp(&right.thread_id.to_string()));
extras.sort_by_key(|entry| entry.thread_id.to_string());
entries.extend(extras);
entries
}
+2 -4
View File
@@ -559,10 +559,8 @@ async fn summarize_context_three_requests_and_instructions() {
RolloutItem::TurnContext(_) => {
regular_turn_context_count += 1;
}
RolloutItem::Compacted(ci) => {
if ci.message == expected_summary_message {
saw_compacted_summary = true;
}
RolloutItem::Compacted(ci) if ci.message == expected_summary_message => {
saw_compacted_summary = true;
}
_ => {}
}
+1 -1
View File
@@ -110,7 +110,7 @@ fn canonical_json(value: &Value) -> Value {
match value {
Value::Object(map) => {
let mut entries = map.iter().collect::<Vec<_>>();
entries.sort_by(|(left_key, _), (right_key, _)| left_key.cmp(right_key));
entries.sort_by_key(|(left_key, _)| *left_key);
Value::Object(
entries
.into_iter()
@@ -1047,7 +1047,7 @@ fn canonical_json(value: &Value) -> Value {
match value {
Value::Object(map) => {
let mut entries = map.iter().collect::<Vec<_>>();
entries.sort_by(|(left_key, _), (right_key, _)| left_key.cmp(right_key));
entries.sort_by_key(|(left_key, _)| *left_key);
Value::Object(
entries
.into_iter()
@@ -638,10 +638,8 @@ async fn snapshot_rollback_followup_turn_trims_context_updates() -> Result<()> {
fn normalize_line_endings(value: &mut Value) {
match value {
Value::String(text) => {
if text.contains('\r') {
*text = text.replace("\r\n", "\n").replace('\r', "\n");
}
Value::String(text) if text.contains('\r') => {
*text = text.replace("\r\n", "\n").replace('\r', "\n");
}
Value::Array(items) => {
for item in items {
@@ -1835,15 +1835,14 @@ async fn conversation_startup_context_current_thread_selects_many_turns_by_budge
"head detail ".repeat(120),
"tail detail ".repeat(170),
);
let mut user_turns = (1..=7)
let user_turns = (1..=7)
.map(|index| {
format!(
"short-turn-{index}-start {} short-turn-{index}-end",
"detail ".repeat(86)
)
})
.collect::<Vec<_>>();
user_turns.push(latest_long_user_turn.clone());
.chain([latest_long_user_turn.clone()]);
let mut builder = test_codex().with_config({
let realtime_base_url = realtime_server.uri().to_string();
@@ -1858,7 +1857,6 @@ async fn conversation_startup_context_current_thread_selects_many_turns_by_budge
// end-to-end startup-context test without paying for a model turn per
// fixture entry in platform CI.
let history = user_turns
.into_iter()
.enumerate()
.flat_map(|(index, user_turn)| {
let turn_number = index + 1;
+2 -4
View File
@@ -312,10 +312,8 @@ impl AppServerClient {
};
match message {
JSONRPCMessage::Response(response) => {
if &response.id == request_id {
return Ok(response);
}
JSONRPCMessage::Response(response) if &response.id == request_id => {
return Ok(response);
}
JSONRPCMessage::Request(request) => {
let _ = handle_server_request(request, &stdin);
+1 -1
View File
@@ -218,7 +218,7 @@ impl LazyRemoteExecServerClient {
}
let next_client = match self.cached_client() {
Some(client)
Some(_client)
if matches!(
&self.transport_params,
ExecServerTransportParams::WebSocketUrl { .. }
+1 -1
View File
@@ -137,7 +137,7 @@ fn sandbox_cwd(sandbox: &FileSystemSandboxContext) -> Result<AbsolutePathBuf, JS
fn helper_read_roots(runtime_paths: &ExecServerRuntimePaths) -> Vec<AbsolutePathBuf> {
let mut roots = Vec::new();
for path in std::iter::once(runtime_paths.codex_self_exe.as_path())
.chain(runtime_paths.codex_linux_sandbox_exe.as_deref().into_iter())
.chain(runtime_paths.codex_linux_sandbox_exe.as_deref())
{
if let Some(parent) = path.parent()
&& let Ok(root) = AbsolutePathBuf::from_absolute_path(parent)
+1 -1
View File
@@ -707,7 +707,7 @@ fn canonicalize_json(value: &Value) -> Value {
Value::Array(items) => Value::Array(items.iter().map(canonicalize_json).collect()),
Value::Object(map) => {
let mut entries: Vec<_> = map.iter().collect();
entries.sort_by(|(left, _), (right, _)| left.cmp(right));
entries.sort_by_key(|(key, _)| *key);
let mut sorted = Map::with_capacity(map.len());
for (key, child) in entries {
sorted.insert(key.clone(), canonicalize_json(child));
+1 -1
View File
@@ -206,7 +206,7 @@ async fn run_jobs(
claimed_candidates: Vec<codex_state::Stage1JobClaim>,
stage_one_context: StageOneRequestContext,
) -> Vec<JobResult> {
futures::stream::iter(claimed_candidates.into_iter())
futures::stream::iter(claimed_candidates)
.map(|claim| {
let context = Arc::clone(&context);
let config = Arc::clone(&config);
+1 -1
View File
@@ -107,7 +107,7 @@ pub trait ModelsManager: fmt::Debug + Send + Sync {
/// Build picker-ready presets from the active catalog snapshot.
fn build_available_models(&self, mut remote_models: Vec<ModelInfo>) -> Vec<ModelPreset> {
remote_models.sort_by(|a, b| a.priority.cmp(&b.priority));
remote_models.sort_by_key(|model| model.priority);
let mut presets: Vec<ModelPreset> = remote_models.into_iter().map(Into::into).collect();
let uses_codex_backend = self
+1 -1
View File
@@ -14,7 +14,7 @@ pub fn get_model_offline_for_tests(model: Option<&str>) -> String {
return model.to_string();
}
let mut response = bundled_models_response().unwrap_or_default();
response.models.sort_by(|a, b| a.priority.cmp(&b.priority));
response.models.sort_by_key(|model| model.priority);
let presets: Vec<ModelPreset> = response.models.into_iter().map(Into::into).collect();
presets
.iter()
+1 -1
View File
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.93.0"
channel = "1.95.0"
components = ["clippy", "rustfmt", "rust-src"]
+1 -1
View File
@@ -179,7 +179,7 @@ if (-not (Ensure-Command 'cargo')) {
Write-Host "==> Configuring Rust toolchain per rust-toolchain.toml" -ForegroundColor Cyan
# Pin to the workspace toolchain and install components
$toolchain = '1.93.0'
$toolchain = '1.95.0'
& rustup toolchain install $toolchain --profile minimal | Out-Host
& rustup default $toolchain | Out-Host
& rustup component add clippy rustfmt rust-src --toolchain $toolchain | Out-Host
+1 -1
View File
@@ -511,7 +511,7 @@ WHERE so.thread_id = ? AND so.source_updated_at = ?
}
}
selected.sort_by(|a, b| a.thread_id.to_string().cmp(&b.thread_id.to_string()));
selected.sort_by_key(|entry| entry.thread_id.to_string());
Ok(selected)
}
+4 -4
View File
@@ -104,10 +104,10 @@ impl ThreadEventStore {
ServerNotification::TurnStarted(turn) => {
self.active_turn_id = Some(turn.turn.id.clone());
}
ServerNotification::TurnCompleted(turn) => {
if self.active_turn_id.as_deref() == Some(turn.turn.id.as_str()) {
self.active_turn_id = None;
}
ServerNotification::TurnCompleted(turn)
if self.active_turn_id.as_deref() == Some(turn.turn.id.as_str()) =>
{
self.active_turn_id = None;
}
ServerNotification::ThreadClosed(_) => {
self.active_turn_id = None;
@@ -1188,11 +1188,9 @@ impl BottomPaneView for RequestUserInputOverlay {
KeyCode::Backspace | KeyCode::Delete => {
self.clear_selection();
}
KeyCode::Tab => {
if self.selected_option_index().is_some() {
self.focus = Focus::Notes;
self.ensure_selected_for_notes();
}
KeyCode::Tab if self.selected_option_index().is_some() => {
self.focus = Focus::Notes;
self.ensure_selected_for_notes();
}
KeyCode::Enter => {
let has_selection = self.selected_option_index().is_some();
+2 -4
View File
@@ -332,10 +332,8 @@ impl ChatWidget {
reasoning_effort,
agents_states,
}),
ThreadItem::EnteredReviewMode { review, .. } => {
if !from_replay {
self.enter_review_mode_with_hint(review, /*from_replay*/ false);
}
ThreadItem::EnteredReviewMode { review, .. } if !from_replay => {
self.enter_review_mode_with_hint(review, /*from_replay*/ false);
}
_ => {}
}
+3 -3
View File
@@ -358,7 +358,7 @@ pub(crate) fn new_mcp_tools_output(
let effective_servers = config.mcp_servers.get().clone();
let mut servers: Vec<_> = effective_servers.iter().collect();
servers.sort_by(|(a, _), (b, _)| a.cmp(b));
servers.sort_by_key(|(server, _)| *server);
for (server, cfg) in servers {
let prefix = qualified_mcp_tool_name_prefix(server);
@@ -430,7 +430,7 @@ pub(crate) fn new_mcp_tools_output(
&& !headers.is_empty()
{
let mut pairs: Vec<_> = headers.iter().collect();
pairs.sort_by(|(a, _), (b, _)| a.cmp(b));
pairs.sort_by_key(|(name, _)| *name);
let display = pairs
.into_iter()
.map(|(name, _)| format!("{name}=*****"))
@@ -442,7 +442,7 @@ pub(crate) fn new_mcp_tools_output(
&& !headers.is_empty()
{
let mut pairs: Vec<_> = headers.iter().collect();
pairs.sort_by(|(a, _), (b, _)| a.cmp(b));
pairs.sort_by_key(|(name, _)| *name);
let display = pairs
.into_iter()
.map(|(name, var)| format!("{name}={var}"))
+1 -1
View File
@@ -58,7 +58,7 @@ fn with_border_internal(
let span_count = line.spans.len();
let mut spans: Vec<Span<'static>> = Vec::with_capacity(span_count + 4);
spans.push(Span::from("").dim());
spans.extend(line.into_iter());
spans.extend(line);
if used_width < content_width {
spans.push(Span::from(" ".repeat(content_width - used_width)).dim());
}
+1 -1
View File
@@ -516,7 +516,7 @@ fn wait_complete_lines(
.then(|| (parsed_thread_id, agent_metadata(parsed_thread_id), status))
})
.collect::<Vec<_>>();
extras.sort_by(|left, right| left.0.to_string().cmp(&right.0.to_string()));
extras.sort_by_key(|entry| entry.0.to_string());
entries.extend(extras);
if entries.is_empty() {
+8 -12
View File
@@ -1159,23 +1159,21 @@ impl PickerState {
self.request_frame();
}
}
_ if allow_plain_char_navigation && self.list_keymap.jump_top.is_pressed(key) => {
if !self.filtered_rows.is_empty() {
_ if allow_plain_char_navigation && self.list_keymap.jump_top.is_pressed(key)
&& !self.filtered_rows.is_empty() => {
self.selected = 0;
self.ensure_selected_visible();
self.request_frame();
}
}
_ if allow_plain_char_navigation && self.list_keymap.jump_bottom.is_pressed(key) => {
if !self.filtered_rows.is_empty() {
_ if allow_plain_char_navigation && self.list_keymap.jump_bottom.is_pressed(key)
&& !self.filtered_rows.is_empty() => {
self.selected = self.filtered_rows.len().saturating_sub(1);
self.ensure_selected_visible();
self.maybe_load_more_for_scroll();
self.request_frame();
}
}
_ if allow_plain_char_navigation && self.list_keymap.page_down.is_pressed(key) => {
if !self.filtered_rows.is_empty() {
_ if allow_plain_char_navigation && self.list_keymap.page_down.is_pressed(key)
&& !self.filtered_rows.is_empty() => {
let step = self.view_rows.unwrap_or(10).max(1);
let target = self.selected.saturating_add(step);
let max_index = self.filtered_rows.len().saturating_sub(1);
@@ -1189,7 +1187,6 @@ impl PickerState {
}
self.request_frame();
}
}
KeyEvent {
code: KeyCode::Tab, ..
} => {
@@ -1222,16 +1219,15 @@ impl PickerState {
code: KeyCode::Char(c),
modifiers,
..
} => {
}
// basic text input for search
if !modifiers.contains(KeyModifiers::CONTROL)
&& !modifiers.contains(KeyModifiers::ALT)
{
=> {
let mut new_query = self.query.clone();
new_query.push(c);
self.set_query(new_query);
}
}
_ => {}
}
Ok(None)
+1 -1
View File
@@ -284,7 +284,7 @@ pub(crate) fn center_truncate_path(path: &str, max_width: usize) -> String {
}
};
for (left_count, right_count) in prioritized.into_iter().chain(fallback.into_iter()) {
for (left_count, right_count) in prioritized.into_iter().chain(fallback) {
let mut segments: Vec<Segment<'_>> = raw_segments[..left_count]
.iter()
.map(|seg| Segment {
+1 -3
View File
@@ -199,10 +199,9 @@ fn render_preview(
0
};
let mut y = area.y.saturating_add(top_pad);
let render_width = area.width.saturating_sub(left_pad);
let style_context = current_diff_render_style_context();
for (idx, row) in preview_rows.iter().enumerate() {
for (y, (idx, row)) in (area.y.saturating_add(top_pad)..).zip(preview_rows.iter().enumerate()) {
if y >= area.y + area.height {
break;
}
@@ -232,7 +231,6 @@ fn render_preview(
Rect::new(area.x.saturating_add(left_pad), y, render_width, 1),
buf,
);
y += 1;
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ pub fn format_env_display<S: AsRef<str>>(
if let Some(map) = env {
let mut pairs: Vec<_> = map.iter().collect();
pairs.sort_by(|(a, _), (b, _)| a.cmp(b));
pairs.sort_by_key(|(key, _)| *key);
parts.extend(pairs.into_iter().map(|(key, _)| format!("{key}=*****")));
}