mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
Fix display of function names in debug
Rust adds some odd `{{closure}}` bits to the function name that need to be removed, otherwise the debug is unreadable. Signed-off-by: David Mulder <dmulder@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
This commit is contained in:
parent
a72146c4ef
commit
8f8943547b
@ -88,10 +88,15 @@ macro_rules! function {
|
||||
}
|
||||
let name = type_name_of(f);
|
||||
|
||||
match &name[..name.len() - 3].rfind(':') {
|
||||
Some(pos) => &name[pos + 1..name.len() - 3],
|
||||
None => &name[..name.len() - 3],
|
||||
}
|
||||
let base_name = match name.rfind("::") {
|
||||
Some(pos) => &name[..pos],
|
||||
None => name,
|
||||
};
|
||||
let parts: Vec<&str> = base_name
|
||||
.split("::")
|
||||
.filter(|&p| p != "{{closure}}")
|
||||
.collect();
|
||||
parts.join("::")
|
||||
}};
|
||||
}
|
||||
|
||||
@ -103,7 +108,7 @@ macro_rules! DBG_PREFIX {
|
||||
let location_cstr = chelps::wrap_string(&location);
|
||||
let function = $crate::function!();
|
||||
let function_msg = format!("{}: ", function);
|
||||
let function_cstr = chelps::wrap_string(function);
|
||||
let function_cstr = chelps::wrap_string(&function);
|
||||
let function_msg_cstr = chelps::wrap_string(&function_msg);
|
||||
let msg = format!($($arg),*);
|
||||
let msg_cstr = chelps::wrap_string(&msg);
|
||||
|
Loading…
Reference in New Issue
Block a user