diff options
| author | Mason Reed <mason@vector35.com> | 2025-12-09 13:24:47 -0500 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2025-12-10 17:35:19 -0500 |
| commit | 393d6dda437d848f51efacceb8618b937d9f08f3 (patch) | |
| tree | b4b1138df7b02fda82765763fe7b1c32268fc22c /rust/src/symbol.rs | |
| parent | b7af0a9b02319aba2875633e4348f459035a4b79 (diff) | |
[Rust] Impl `Display` for `Symbol`
Diffstat (limited to 'rust/src/symbol.rs')
| -rw-r--r-- | rust/src/symbol.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rust/src/symbol.rs b/rust/src/symbol.rs index 094aeba7..fac8cae5 100644 --- a/rust/src/symbol.rs +++ b/rust/src/symbol.rs @@ -15,7 +15,7 @@ //! Interfaces for the various kinds of symbols in a binary. use std::fmt; -use std::fmt::Debug; +use std::fmt::{Debug, Display, Formatter}; use std::hash::{Hash, Hasher}; use std::ptr; @@ -349,3 +349,9 @@ impl PartialEq for Symbol { self.handle == other.handle } } + +impl Display for Symbol { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str(&self.short_name().to_string_lossy()) + } +} |
