Skip to content

Commit 7a8b109

Browse files
committed
Update documentation
1 parent b0bead8 commit 7a8b109

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/lib.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,14 @@ pub struct Demangle<'a> {
4343

4444
/// De-mangles a Rust symbol into a more readable version
4545
///
46-
/// All rust symbols by default are mangled as they contain characters that
46+
/// All Rust symbols by default are mangled as they contain characters that
4747
/// cannot be represented in all object files. The mangling mechanism is similar
4848
/// to C++'s, but Rust has a few specifics to handle items like lifetimes in
4949
/// symbols.
5050
///
51-
/// This function will take a **mangled** symbol (typically acquired from a
52-
/// `Symbol` which is in turn resolved from a `Frame`) and then writes the
53-
/// de-mangled version into the given `writer`. If the symbol does not look like
54-
/// a mangled symbol, it is still written to `writer`.
51+
/// This function will take a **mangled** symbol and return a value. When printed,
52+
/// the de-mangled version will be written. If the symbol does not look like
53+
/// a mangled symbol, the original value will be written instead.
5554
///
5655
/// # Examples
5756
///
@@ -63,7 +62,7 @@ pub struct Demangle<'a> {
6362
/// assert_eq!(demangle("foo").to_string(), "foo");
6463
/// ```
6564
66-
// All rust symbols are in theory lists of "::"-separated identifiers. Some
65+
// All Rust symbols are in theory lists of "::"-separated identifiers. Some
6766
// assemblers, however, can't handle these characters in symbol names. To get
6867
// around this, we use C++-style mangling. The mangling method is:
6968
//
@@ -82,7 +81,7 @@ pub struct Demangle<'a> {
8281
// etc. Additionally, this doesn't handle glue symbols at all.
8382
pub fn demangle(mut s: &str) -> Demangle {
8483
// During ThinLTO LLVM may import and rename internal symbols, so strip out
85-
// those endings first as they're on of the last manglings applied to symbol
84+
// those endings first as they're one of the last manglings applied to symbol
8685
// names.
8786
let llvm = ".llvm.";
8887
if let Some(i) = s.find(llvm) {
@@ -100,7 +99,7 @@ pub fn demangle(mut s: &str) -> Demangle {
10099
}
101100

102101
// First validate the symbol. If it doesn't look like anything we're
103-
// expecting, we just print it literally. Note that we must handle non-rust
102+
// expecting, we just print it literally. Note that we must handle non-Rust
104103
// symbols because we could have any function in the backtrace.
105104
let mut valid = true;
106105
let mut inner = s;

0 commit comments

Comments
 (0)