Skip to content

utilize new fallible methods#18

Merged
acarl005 merged 3 commits intowarpfrom
andy/fallible-font-methods
Feb 18, 2026
Merged

utilize new fallible methods#18
acarl005 merged 3 commits intowarpfrom
andy/fallible-font-methods

Conversation

@acarl005
Copy link

Following up on my work in warpdotdev/dwrote-rs#2 this PR migrates to the new methods.

@acarl005 acarl005 requested review from vorporeal and removed request for vorporeal February 12, 2026 19:59
.unwrap_or_else(|| dwrite_font.family_name())
.ok()
.flatten()
.unwrap_or_else(|| dwrite_font.family_name().unwrap_or_default())
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh I don't love the unwrap_or_default here. This should probably return a Result too but AFAICT getting the full name from an existing Font struct is for displaying the the user and for that purpose an empty string seems fine. That's all we use it for:

https://github.com/warpdotdev/warp-internal/blob/101359bbe9406fee3b095cdcc05bdc8930d11b20/crates/warpui/src/windowing/winit/fonts/windows.rs#L221-L221

@acarl005 acarl005 requested a review from vorporeal February 12, 2026 20:13
Comment on lines 118 to 121
return Handle::Memory {
bytes: Arc::new(vec![]),
font_index: 0,
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the right fallback? should we be propagating up an error?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! We definitely should be propagating the error. Fixed

@acarl005 acarl005 merged commit a04b225 into warp Feb 18, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments