Skip to content

Commit 992ac04

Browse files
committed
build: update to rust 1.84.0
1 parent fcd4003 commit 992ac04

File tree

19 files changed

+33
-41
lines changed

19 files changed

+33
-41
lines changed

.github/workflows/rust.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Install dependencies (macOS)
3030
if: runner.os == 'Macos'
3131
run: brew install protobuf fish shellcheck
32-
- uses: dtolnay/rust-toolchain@1.83.0
32+
- uses: dtolnay/rust-toolchain@1.84.0
3333
id: toolchain
3434
with:
3535
components: clippy

crates/alacritty_terminal/src/ansi.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,7 @@ fn parse_number(input: &[u8]) -> Option<u8> {
109109
for c in input {
110110
let c = *c as char;
111111
if let Some(digit) = c.to_digit(10) {
112-
num = match num.checked_mul(10).and_then(|v| v.checked_add(digit as u8)) {
113-
Some(v) => v,
114-
None => return None,
115-
}
112+
num = num.checked_mul(10).and_then(|v| v.checked_add(digit as u8))?;
116113
} else {
117114
return None;
118115
}
@@ -1012,7 +1009,7 @@ where
10121009
match (action, intermediates) {
10131010
('s', [b'=']) => {
10141011
// Start a synchronized update. The end is handled with a separate parser.
1015-
if params.iter().next().map_or(false, |param| param[0] == 1) {
1012+
if params.iter().next().is_some_and(|param| param[0] == 1) {
10161013
self.state.dcs = Some(Dcs::SyncStart);
10171014
}
10181015
},

crates/fig_api_client/src/error.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ impl Error {
5555
pub fn is_throttling_error(&self) -> bool {
5656
match self {
5757
Error::Credentials(_) => false,
58-
Error::GenerateCompletions(e) => e.as_service_error().map_or(false, |e| e.is_throttling_error()),
59-
Error::GenerateRecommendations(e) => e.as_service_error().map_or(false, |e| e.is_throttling_error()),
60-
Error::ListAvailableCustomizations(e) => e.as_service_error().map_or(false, |e| e.is_throttling_error()),
61-
Error::ListAvailableServices(e) => e.as_service_error().map_or(false, |e| e.is_throttling_error()),
58+
Error::GenerateCompletions(e) => e.as_service_error().is_some_and(|e| e.is_throttling_error()),
59+
Error::GenerateRecommendations(e) => e.as_service_error().is_some_and(|e| e.is_throttling_error()),
60+
Error::ListAvailableCustomizations(e) => e.as_service_error().is_some_and(|e| e.is_throttling_error()),
61+
Error::ListAvailableServices(e) => e.as_service_error().is_some_and(|e| e.is_throttling_error()),
6262
Error::CodewhispererGenerateAssistantResponse(e) => {
63-
e.as_service_error().map_or(false, |e| e.is_throttling_error())
63+
e.as_service_error().is_some_and(|e| e.is_throttling_error())
6464
},
65-
Error::QDeveloperSendMessage(e) => e.as_service_error().map_or(false, |e| e.is_throttling_error()),
65+
Error::QDeveloperSendMessage(e) => e.as_service_error().is_some_and(|e| e.is_throttling_error()),
6666
Error::CodewhispererChatResponseStream(_)
6767
| Error::QDeveloperChatResponseStream(_)
6868
| Error::SmithyBuild(_)

crates/fig_auth/src/builder_id.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ pub async fn refresh_token() -> Result<Option<BuilderIdToken>> {
547547
}
548548

549549
pub async fn is_amzn_user() -> Result<bool> {
550-
Ok(builder_id_token().await?.map_or(false, |t| t.is_amzn_user()))
550+
Ok(builder_id_token().await?.is_some_and(|t| t.is_amzn_user()))
551551
}
552552

553553
pub async fn is_logged_in() -> bool {

crates/fig_desktop/src/platform/macos.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ impl PlatformStateImpl {
489489
// Checking if IME is installed is async :(
490490
let enabled_proxy = self.proxy.clone();
491491
tokio::spawn(async move {
492-
let is_terminal_disabled = current_terminal.as_ref().map_or(false, |terminal| {
492+
let is_terminal_disabled = current_terminal.as_ref().is_some_and(|terminal| {
493493
fig_settings::settings::get_bool_or(
494494
format!("integrations.{}.disabled", terminal.internal_id()),
495495
false,
@@ -558,7 +558,7 @@ impl PlatformStateImpl {
558558
let dashboard_visible = dashboard_visible.unwrap_or_else(|| {
559559
window_map
560560
.get(&DASHBOARD_ID)
561-
.map_or(false, |window| window.window.is_visible())
561+
.is_some_and(|window| window.window.is_visible())
562562
});
563563

564564
if dashboard_visible {

crates/fig_desktop/src/protocol/icons.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub async fn process_asset(path: PathBuf) -> Result<ProcessedAsset> {
114114
let is_svg = path
115115
.extension()
116116
.and_then(OsStr::to_str)
117-
.map_or(true, |ext| ext.to_lowercase() == "svg");
117+
.is_none_or(|ext| ext.to_lowercase() == "svg");
118118

119119
let built = if is_svg {
120120
(Arc::new(tokio::fs::read(&path).await?.into()), AssetKind::Svg)

crates/fig_desktop/src/remote_ipc/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl fig_remote_ipc::RemoteHookHandler for RemoteHook {
8080
let current_session_expired = session
8181
.current_session_metrics
8282
.as_ref()
83-
.map_or(false, |metrics| received_at > metrics.end_time + Duration::from_secs(5));
83+
.is_some_and(|metrics| received_at > metrics.end_time + Duration::from_secs(5));
8484

8585
if current_session_expired {
8686
let previous = session.current_session_metrics.clone();

crates/fig_desktop/src/utils.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ where
7676
.headers()
7777
.get("Accept")
7878
.and_then(|accept| accept.to_str().ok())
79-
.and_then(|accept| accept.split('/').last())
80-
.map_or(false, |accept| accept == "json");
79+
.is_some_and(|accept| accept.split('/').last() == Some("json"));
8180

8281
let mut response = match f(ctx_clone, req, window_id.window_id()).in_current_span().await {
8382
Ok(res) => res,

crates/fig_desktop_api/src/init_script.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl Constants {
113113
new_uri_format: true,
114114
support_api_proto,
115115
api_proto_url: "api://localhost".to_string(),
116-
midway: midway_cookie_path().map_or(false, |p| p.is_file()),
116+
midway: midway_cookie_path().is_ok_and(|p| p.is_file()),
117117
#[cfg(target_os = "macos")]
118118
macos_version: macos_utils::os::OperatingSystemVersion::get().to_string(),
119119
#[cfg(target_os = "linux")]

crates/fig_os_shim/src/env.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl Env {
142142

143143
pub fn in_cloudshell(&self) -> bool {
144144
self.get("AWS_EXECUTION_ENV")
145-
.map_or(false, |v| v.trim().eq_ignore_ascii_case("cloudshell"))
145+
.is_ok_and(|v| v.trim().eq_ignore_ascii_case("cloudshell"))
146146
}
147147

148148
pub fn in_ssh(&self) -> bool {

crates/figterm/src/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,9 @@ where
320320
Some(at) => {
321321
let lock_expired = at.elapsed().unwrap_or(Duration::ZERO) > Duration::from_millis(16);
322322
let should_unlock = lock_expired
323-
|| term.get_current_buffer().map_or(true, |buff| {
324-
&buff.buffer == (&EXPECTED_BUFFER.lock().unwrap() as &String)
325-
});
323+
|| term
324+
.get_current_buffer()
325+
.is_none_or(|buff| &buff.buffer == (&EXPECTED_BUFFER.lock().unwrap() as &String));
326326
if should_unlock {
327327
handle.take();
328328
if lock_expired {

crates/q_cli/src/util/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ pub async fn is_brew_reinstall() -> bool {
310310
.args(["aux", "-o", "args"])
311311
.output()
312312
.await
313-
.map_or(false, |output| regex.is_match(&output.stdout))
313+
.is_ok_and(|output| regex.is_match(&output.stdout))
314314
}
315315

316316
#[cfg(test)]

crates/shell-color/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ pub struct SuggestionColor {
1010

1111
impl SuggestionColor {
1212
pub fn fg(&self) -> Option<VTermColor> {
13-
self.fg.clone().map(VTermColor::from)
13+
self.fg.clone()
1414
}
1515

1616
pub fn bg(&self) -> Option<VTermColor> {
17-
self.bg.clone().map(VTermColor::from)
17+
self.bg.clone()
1818
}
1919
}
2020

crates/zbus/src/abstractions/executor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub struct Executor<'a> {
3737
phantom: PhantomData<&'a ()>,
3838
}
3939

40-
impl<'a> Executor<'a> {
40+
impl Executor<'_> {
4141
/// Spawns a task onto the executor.
4242
#[doc(hidden)]
4343
pub fn spawn<T: Send + 'static>(

crates/zbus/src/address/transport/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,10 @@ pub(crate) fn decode_percents(value: &str) -> Result<Vec<u8>> {
267267
decoded.push(c as u8);
268268
} else if c == '%' {
269269
decoded.push(
270-
decode_hex(
270+
(decode_hex(
271271
iter.next()
272272
.ok_or_else(|| Error::Address("incomplete percent-encoded sequence".to_owned()))?,
273-
)? << 4
273+
)? << 4)
274274
| decode_hex(
275275
iter.next()
276276
.ok_or_else(|| Error::Address("incomplete percent-encoded sequence".to_owned()))?,

crates/zbus/src/guid.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl<'de> Deserialize<'de> for Guid<'de> {
146146
}
147147

148148
fn validate_guid(value: &str) -> crate::Result<()> {
149-
if value.as_bytes().len() != 32 || value.chars().any(|c| !char::is_ascii_hexdigit(&c)) {
149+
if value.len() != 32 || value.chars().any(|c| !char::is_ascii_hexdigit(&c)) {
150150
return Err(crate::Error::InvalidGUID);
151151
}
152152

crates/zbus/src/message/field.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,15 @@ impl<'de: 'f, 'f> Deserialize<'de> for Field<'f> {
151151
FieldCode::Path => Field::Path(ObjectPath::try_from(value).map_err(D::Error::custom)?),
152152
FieldCode::Interface => Field::Interface(InterfaceName::try_from(value).map_err(D::Error::custom)?),
153153
FieldCode::Member => Field::Member(MemberName::try_from(value).map_err(D::Error::custom)?),
154-
FieldCode::ErrorName => {
155-
Field::ErrorName(ErrorName::try_from(value).map(Into::into).map_err(D::Error::custom)?)
156-
},
154+
FieldCode::ErrorName => Field::ErrorName(ErrorName::try_from(value).map_err(D::Error::custom)?),
157155
FieldCode::ReplySerial => {
158156
let value = u32::try_from(value)
159157
.map_err(D::Error::custom)
160158
.and_then(|v| v.try_into().map_err(D::Error::custom))?;
161159
Field::ReplySerial(value)
162160
},
163-
FieldCode::Destination => {
164-
Field::Destination(BusName::try_from(value).map(Into::into).map_err(D::Error::custom)?)
165-
},
166-
FieldCode::Sender => Field::Sender(UniqueName::try_from(value).map(Into::into).map_err(D::Error::custom)?),
161+
FieldCode::Destination => Field::Destination(BusName::try_from(value).map_err(D::Error::custom)?),
162+
FieldCode::Sender => Field::Sender(UniqueName::try_from(value).map_err(D::Error::custom)?),
167163
FieldCode::Signature => Field::Signature(Signature::try_from(value).map_err(D::Error::custom)?),
168164
FieldCode::UnixFDs => Field::UnixFDs(u32::try_from(value).map_err(D::Error::custom)?),
169165
})

crates/zbus/src/proxy/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ pub struct PropertyChanged<'a, T> {
189189
phantom: std::marker::PhantomData<T>,
190190
}
191191

192-
impl<'a, T> PropertyChanged<'a, T> {
192+
impl<T> PropertyChanged<'_, T> {
193193
/// The name of the property that changed.
194194
pub fn name(&self) -> &str {
195195
self.name
@@ -200,7 +200,7 @@ impl<'a, T> PropertyChanged<'a, T> {
200200
/// If the notification signal contained the new value, it has been cached already and this call
201201
/// will return that value. Otherwise (i.e. invalidated property), a D-Bus call is made to fetch
202202
/// and cache the new value.
203-
pub async fn get_raw<'p>(&'p self) -> Result<impl Deref<Target = Value<'static>> + 'p> {
203+
pub async fn get_raw(&self) -> Result<impl Deref<Target = Value<'static>> + '_> {
204204
struct Wrapper<'w> {
205205
name: &'w str,
206206
values: RwLockReadGuard<'w, HashMap<String, PropertyValue>>,

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[toolchain]
2-
channel = "1.83.0"
2+
channel = "1.84.0"
33
profile = "minimal"
44
components = ["rustfmt", "clippy"]
55
targets = [

0 commit comments

Comments
 (0)