Repository navigation
Doc typo fix for struct winit::Window - #452
Conversation
|
Whoops, didn't [ci skip] this, sorry! |
|
This change seems appropriate, although I feel that there is a linking verb missing. |
|
Did you spot the 'matches' on the line below? With that, I think it reads fine. |
|
I would like to preface this by stating that I have not attempted to learn this particular dialect by going through previous comments, so take this with a grain of salt. The phrase I'm keying in on is "if nothing". It sounds like it is missing an object compliment after it (i.e. "if nothing has happened" or "if nothing is present"). I think the parsimonious way to make this flow better is to say "if it is nothing" (which is the linking verb I was thinking of). I can tell that the line of thinking for this comment is a basic branch structured as "if x than y or if not x than z", but that doesn't translate well into natural language. Personally I would rephrase to more explicitly follow the schema of "if x than y, or if not possible z" (for example "...or the primary monitor if there is no current monitor"). I am aware that this new schema is semantically identical to the previous one, but it translates better into natural language. It is a tad redundant, but it does more explicitly explain what is going on while still being succinct. I did not spot the "matches". I believe it is semantically null, so would be in favor of axing it entirely. |
|
True, it isn't exactly clear what it means for there to be no matches. I'm not familiar enough with the codebase to know why there wouldn't be any matches for the current monitor. I'll look into that, and then maybe this sentence could be rewritten to be a bit more descriptive. |
|
I was initially going to tell you that this PR could be merged as-is, but...
...then I realized that I don't actually know this either. I've thus investigated:
So you've inadvertently caused the discovery that the doc comment isn't even accurate, which I'd say is a victory for winit! |
|
In that case, do you think it's even necessary to mention the possiblity of 'no matches' in the documentation? Or something akin to "if a window's monitor cannot not be determined for certain, a platform-specifc best guess is returned." |
|
Oh, I'll bet that that was what the "matches" comment was for! |
|
I personally don't think it's necessary. There aren't really any reasonable cases where there won't be a match. |
|
I probably should have been more clear, I still believe that the "matches" comment is semantically null. Any use it may have had is met with a descriptive comment about the purpose of the function. I merely now understand it's (probable) former purpose. |
84c42c1 to
c63043d
Compare
|
@virome I see that you updated your commit, so I assume you're ready for me to merge this. For future reference, GitHub didn't send me a notification when that happened; IIRC it only notifies me if you add commits, so it's always good to comment to give me a heads up. Anyway, thanks for the contribution! |
|
@francesca64 Good to know! |
Fix arm simd shuffling arguments According to packed_simd docs, the syntax for simd_shuffle4() is as follows: "The indices must be in range [0, M * N) where M is the number of input vectors (1 or 2)and N is the number of lanes of the input vectors. The indices i in range [0, N) refer to the i-th element of vec0, while the indices in range [N, 2*N) refer to the i - N-th element of vec1." I did not find implementation or documentation for simd_shuffle4() but I believe packed_simd implements exactly the same interface. Plus, implementing this change has fixed font-kit glyph output on an Apple M1 mac (64-bit arm). Closes rust-windowing#450
No description provided.