Skip to content

Commit

Permalink
natvis
Browse files Browse the repository at this point in the history
  • Loading branch information
Arlie Davis committed Jun 26, 2024
1 parent 00d7345 commit f04a949
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions crates/libs/result/.natvis
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="windows_result::error::Error">
<DisplayString>{(HRESULT)code.__0.__0}</DisplayString>
<Expand>
<ExpandedItem>code</ExpandedItem>
<ExpandedItem>(HRESULT)code.__0.__0,hr</ExpandedItem>
<Item Name="[code]">(HRESULT)code.__0.__0</Item>
<Item Name="[info]">info</Item>
<Item Name="[info]">info.ptr</Item>
</Expand>
</Type>

Expand Down
5 changes: 3 additions & 2 deletions crates/libs/result/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ use core::mem::size_of;
/// * [`IErrorInfo`](https://learn.microsoft.com/en-us/windows/win32/api/oaidl/nn-oaidl-ierrorinfo)
#[derive(Clone)]
pub struct Error {
/// The `HRESULT` error code, but represented using `NonZeroI32`. The `NonZeroHRESULT` provides
/// The `HRESULT` error code, but represented using [`NonZeroI32`]. [`NonZeroI32`] provides
/// a "niche" to the Rust compiler, which is a space-saving optimization. This allows the
/// compiler to use more compact representations in some sitatutions.
/// compiler to use more compact representation for enum variants (such as [`Result`]) that
/// contain instances of [`Error`].
code: NonZeroI32,

/// Contains details about the error, such as error text.
Expand Down

0 comments on commit f04a949

Please sign in to comment.