Code Monkey home page Code Monkey logo

arraystring's People

Contributors

paulocsanz avatar wicpar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

arraystring's Issues

Diesel AsChangeset

Hello,
I'm trying to use ArrayString with diesel and it fails to derive AsChangeset.

table! {
    ...
    users (id) {
        ...
        password_hash -> Varchar,
        ...
    }
}

type PasswordHash = ArrayString<U64>;

#[derive(AsChangeset, Default, Debug)]
#[table_name = "users"]
pub struct UserSettingsChangeset {
    pub password_hash: Option<PasswordHash>,
    ...
}

will lead to:

type mismatch resolving

  • <&arraystring::ArrayString<arraystring::typenum::UInt<arraystring::typenum::UInt<arraystring::typenum::UInt<arraystring::typenum::UInt<arraystring::typenum::UInt<arraystring::typenum::UInt<arraystring::typenum::UTerm, arraystring::typenum::B1>, arraystring::typenum::B1>, arraystring::typenum::B0>, arraystring::typenum::B0>, arraystring::typenum::B1>, arraystring::typenum::B0>> as diesel::Expression>::SqlType == diesel::sql_types::Nullable<diesel::sql_types::Text>
  • expected struct diesel::sql_types::Text, found struct diesel::sql_types::Nullable
  • expected struct diesel::sql_types::Text
    found struct diesel::sql_types::Nullable<diesel::sql_types::Text>

It works with normal String...Option<T> in AsChangeset should just skip the field during update.

Any ideas what I'm doing wrong? Thank you

Master fails tests

I just merged my master with yours, since i didn't touch the master and the tests passed when i pushed my const N PR i can only wonder what happened...
Have you run the tests lately, did they succeed ?

Notes on interesting tools for safe or performant implementation:

This is a personal reminder, but if anyone wants to do it first feel free.

  • 100% safe panic free truncate with split_at (if the optimizer would be so kind as to know that we already checked if mid > len)
  • faster copy with small types creating a custom copy loop: it looks like the use of ptrs in the std function forces the ptrs to actually exist, where an inlined loop would probably be optimized into register operations (please benchmark exhaustively the variato)
  • base as many operations as possible with a variation of replace_range if it is properly able to optimize it into the derived ones (remove, insert, push, etc...) (Please see if assembly is identical, or at least performance identical)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.