-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add examples to documentation for std::base64 #5879
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…64 and from_base64
…n the impl blocks.
Mostly just phrasing things differently, which is a matter of taste. Feel free to use or not use any of the changes I'm suggesting. I would say this one thing should be changed, though, not necessarily the way I changed it here. * Convert any string (literal, `@`, `&`, `~`) * that contains a base64 encoded value, to the byte values it encodes. If this structure is going to be used, either the entire clause, 'that contains a base64 encoded value', should be bracketed by commas, or the comma at the end of the clause should be removed.
Doc review, as requested :-).
Thanks, having examples really makes the documentation a lot nicer. Could you switch it to use 4-space indents though? That's the style used by the rest of the codebase. |
bors
added a commit
that referenced
this pull request
Apr 15, 2013
…hism This adds examples for the methods in std::base64. Each example is complete in the sense that you can copy-paste it into a file and compile it successfully without adding anything (imports, etc). The hardest part of figuring out how to use this was figuring out the right import statements to put at the top.
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Aug 28, 2020
…nts, r=Manishearth,flip1995 Parse doctests in needless_doctest_main This switches from text-based search to running the parser to avoid false positives. Inspired by how [rustdoc](https://github.com/rust-lang/rust/blob/3f3250500fe152b5759c21453ba9a9129808d0d8/src/librustdoc/test.rs#L366) handles this and by rust-lang#4729. cc @llogiq changelog: Fix multiple false positives in [`needless_doctest_main`]. Fixes rust-lang#5879 Fixes rust-lang#4906 Fixes rust-lang#5103 Fixes rust-lang#4698
calebcartwright
pushed a commit
to calebcartwright/rust
that referenced
this pull request
Oct 23, 2023
* Prevent ICE when formatting item-only `vec!{}` Fixes 5735 Attempting to format invocations of macros which are considered "forced bracket macros" (currently only `vec!`), but are invoked with braces instead of brackets, and contain only items in their token trees, currently triggers an ICE in rustfmt. This is because the function that handles formatting macro invocations containing only items, `rewrite_macro_with_items`, assumes that the forced delimiter style of the macro being formatted is the same as the delimiter style in the macro's source text when attempting to locate the span after the macro's opening delimiter. This leads to the construction of an invalid span, triggering the ICE. The fix here is to pass the old delimiter style to `rewrite_macro_with_items` as well, so that it can successfully locate the span.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds examples for the methods in std::base64.
Each example is complete in the sense that you can copy-paste it into a file and compile it successfully without adding anything (imports, etc). The hardest part of figuring out how to use this was figuring out the right import statements to put at the top.