You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally I thought this was a duplicate of #4992#4800. Both of those issues are fixed when using version=Two.
Unfortunately the call to Bytes::copy_from_slice is what makes this a different issues. Because the string literal is way longer than the default of max_width rustfmt fails to format Bytes::copy_from_slice, which prevents rustfmt from formatting the Event struct.
I think your best option here is to refactor your code:
Option 3:
input
fntest_fetch_existing_receipt(){let data = Bytes::copy_from_slice(&b"vtho-usd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x84\x17\x19\x1a\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0e\x7f\x8eJ"[..]);let expected =
Event{topics:1,
data
};}
Output
fntest_fetch_existing_receipt(){let data = Bytes::copy_from_slice(&b"vtho-usd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x84\x17\x19\x1a\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0e\x7f\x8eJ"[..]);let expected = Event{topics:1, data };}
This terrible input (reduced from some larger struct with 2 levels of nesting) is left as-is.
Applies to both current nightly and stable:
I wanted to just split a struct copied from terminal output, but ended up doing it manually:(
The text was updated successfully, but these errors were encountered: