MCPcopy Create free account
hub / github.com/apache/datafusion / assert_starts_with

Function assert_starts_with

datafusion/common/src/scalar/mod.rs:10033–10040  ·  view source on GitHub ↗

`err.to_string()` depends on backtrace being present (may have backtrace appended) `err.strip_backtrace()` also depends on backtrace being present (may have "This was likely caused by ..." stripped)

(actual: impl AsRef<str>, expected_prefix: impl AsRef<str>)

Source from the content-addressed store, hash-verified

10031 // `err.to_string()` depends on backtrace being present (may have backtrace appended)
10032 // `err.strip_backtrace()` also depends on backtrace being present (may have "This was likely caused by ..." stripped)
10033 fn assert_starts_with(actual: impl AsRef<str>, expected_prefix: impl AsRef<str>) {
10034 let actual = actual.as_ref();
10035 let expected_prefix = expected_prefix.as_ref();
10036 assert!(
10037 actual.starts_with(expected_prefix),
10038 "Expected '{actual}' to start with '{expected_prefix}'"
10039 );
10040 }
10041
10042 #[test]
10043 fn test_new_default() {

Callers 2

test_try_cmpFunction · 0.70

Calls 1

as_refMethod · 0.45

Tested by 2

test_try_cmpFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…