GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Embed Notice

HTML Code

Corresponding Notice

  1. Embed this notice
    Cassandra Granade 🏳️‍⚧️ (xgranade@wandering.shop)'s status on Monday, 30-Dec-2024 06:36:38 JSTCassandra Granade 🏳️‍⚧️Cassandra Granade 🏳️‍⚧️
    in reply to
    • mcc

    @mcc The language feature was approved with https://github.com/rust-lang/rfcs/pull/3681, and documents that yeah, #[derive(Default)] will work if every field has a default value or itself implements Default.

    From the RFC:

    ```
    #[derive(Default)]
    struct Pet {
    name: Option<String>, // impl Default for Pet will use Default::default() for name
    age: i128 = 42, // impl Default for Pet will use the literal 42 for age
    }
    ```

    In conversation6 months ago from wandering.shoppermalink

    Attachments

    1. Domain not in remote thumbnail source whitelist: opengraph.githubassets.com
      [RFC] Default field values by estebank · Pull Request #3681 · rust-lang/rfcs
      Allow struct definitions to provide default values for individual fields and thereby allowing those to be omitted from initializers. When deriving Default, the provided values will then be used. Fo...
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.

Embed this notice