There are three struct forms: unit structs, tuple structs, and named field structs:
struct UnitStruct;
struct TupleStruct(String, usize);
struct NamedStruct { string: String, is_cuss_word: bool }
2018-12-27
So I had a frustrating week, last week. I'd been spending much of december working on a long-standing feature for xi, line breaking / word wrap. That is; the ability to wrap lines of text to the width of the window, as needed. This is table stakes for a text editor (or a text view, or a web browser, or anything that displays text in a variable width window) but it's something we had until now only half-done.
This problem has some nuance. To back up: We have a string, and we have a width (of a window, say), and we need to determine how to break the string up so that it fits in the given window. To do this, we need to know two things at runtime: where in the string we are allowed to create a line break (the break opportunities), and the width required to draw various 'atoms' of the string, where an 'atom' is a sub-string that cannot contain a line break.
const SSID_OPTS: i32 = _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_EACH | _SIDD_UNIT_MASK | |
| _SIDD_LEAST_SIGNIFICANT | _SIDD_NEGATIVE_POLARITY; | |
/// # Examples | |
/// | |
/// ``` | |
/// let one = "aaaaaaaaaaaaaaaa"; | |
/// let two = "aa3aaaaa9aaaEaaa"; | |
/// //NOTE: reversed | |
/// let exp = "0001000100000100"; |
#!/bin/bash | |
WARNINGTAGS="FIXME:|\?\?\?:" | |
ERRORTAGS="\!\!\!:" | |
find "${SRCROOT}" \( -name "*.swift" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($WARNINGTAGS).*\$" | perl -p -e "s/($WARNINGTAGS)/ warning: \$1/" | |
if [ "${CONFIGURATION}" = "Release" ] | |
then | |
find "${SRCROOT}" \( -name "*.swift" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($ERRORTAGS).*\$" | perl -p -e "s/($ERRORTAGS)/ error: \$1/" |
I hereby claim:
To claim this, I am signing this object: