@@ -2,7 +2,8 @@ use sentry_core::protocol::{Frame, Stacktrace};
22
33use crate :: utils:: function_starts_with;
44
5- const WELL_KNOWN_SYS_MODULES : & [ & str ] = & [
5+ const WELL_KNOWN_NOT_IN_APP : & [ & str ] = & [
6+ // standard library and sentry crates
67 "std::" ,
78 "core::" ,
89 "alloc::" ,
@@ -13,11 +14,14 @@ const WELL_KNOWN_SYS_MODULES: &[&str] = &[
1314 // these are not modules but things like __rust_maybe_catch_panic
1415 "__rust_" ,
1516 "___rust_" ,
17+ "rust_begin_unwind" ,
1618 // these are well-known library frames
1719 "anyhow::" ,
1820 "log::" ,
1921 "tokio::" ,
2022 "tracing_core::" ,
23+ "futures_core::" ,
24+ "futures_util::" ,
2125] ;
2226
2327const WELL_KNOWN_BORDER_FRAMES : & [ & str ] = & [
3943 . iter ( )
4044 . rev ( )
4145 . position ( |frame| match frame. function {
42- Some ( ref func) => is_well_known ( func) || f ( frame, stacktrace) ,
46+ Some ( ref func) => is_well_known_border_frame ( func) || f ( frame, stacktrace) ,
4347 None => false ,
4448 } ) ;
4549
@@ -49,15 +53,15 @@ where
4953 }
5054}
5155
52- /// Checks if a function is considered to be not in-app
53- pub fn is_sys_function ( func : & str ) -> bool {
54- WELL_KNOWN_SYS_MODULES
56+ /// Checks if a function is from a module that shall be considered not in-app by default
57+ pub fn is_well_known_not_in_app ( func : & str ) -> bool {
58+ WELL_KNOWN_NOT_IN_APP
5559 . iter ( )
5660 . any ( |m| function_starts_with ( func, m) )
5761}
5862
59- /// Checks if a function is a well-known system function
60- fn is_well_known ( func : & str ) -> bool {
63+ /// Checks if a function is a well-known border frame
64+ fn is_well_known_border_frame ( func : & str ) -> bool {
6165 WELL_KNOWN_BORDER_FRAMES
6266 . iter ( )
6367 . any ( |m| function_starts_with ( func, m) )
0 commit comments