Skip to content
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 7 commits into from
Apr 16, 2013

Conversation

astrieanna
Copy link
Contributor

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.

astrieanna and others added 6 commits April 12, 2013 09:41
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.
@thestinger
Copy link
Contributor

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.
@bors bors closed this Apr 16, 2013
@bors bors merged commit b5c9990 into rust-lang:incoming Apr 16, 2013
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants