Coder Social home page Coder Social logo

rphtml's People

Contributors

fefit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

isgasho

rphtml's Issues

htmlentity changed its API in v1.3.0

Hi there,

htmlentity changed its API in the newly released version 1.3.0. rphtml pulls that dependency in "1.2.0" which allows cargo to update the dependency to this version. That means rphtml wont compile any longer. From a freshly checked out repository:

$ cargo build

    Updating crates.io index
   Compiling proc-macro2 v1.0.56
   Compiling quote v1.0.26
   Compiling unicode-ident v1.0.8
   Compiling thiserror v1.0.40
   Compiling anyhow v1.0.70
   Compiling lazy_static v1.4.0
   Compiling syn v2.0.15
   Compiling thiserror-impl v1.0.40
   Compiling htmlentity v1.3.0
   Compiling rphtml v0.5.8 (/Users/ckruse/rphtml)
error[E0432]: unresolved imports `htmlentity::entity::encode_chars`, `htmlentity::entity::EntitySet`
 --> src/parser.rs:6:43
  |
6 | use htmlentity::entity::{decode_chars_to, encode_chars, EncodeType, Entity, EntitySet};
  |                                           ^^^^^^^^^^^^                      ^^^^^^^^^ no `EntitySet` in `entity`
  |                                           |
  |                                           no `encode_chars` in `entity`
  |
help: a similar name exists in the module
  |
6 | use htmlentity::entity::{decode_chars_to, encode_char, EncodeType, Entity, EntitySet};
  |                                           ~~~~~~~~~~~
help: a similar name exists in the module
  |
6 | use htmlentity::entity::{decode_chars_to, encode_chars, EncodeType, Entity, Entity};
  |                                                                             ~~~~~~

error[E0308]: mismatched types
   --> src/parser.rs:569:47
    |
569 | ...                   if let Some(decoded) = Entity::decode(entity) {
    |                                              -------------- ^^^^^^ expected `u8`, found `char`
    |                                              |
    |                                              arguments to this function are incorrect
    |
    = note: expected reference `&[u8]`
               found reference `&[char]`
note: associated function defined here
   --> /Users/ckruse/.cargo/registry/src/github.com-1ecc6299db9ec823/htmlentity-1.3.0/src/entity.rs:838:10
    |
838 |   pub fn decode(bytes: &[Byte]) -> AnyhowResult<char> {
    |          ^^^^^^

error[E0308]: mismatched types
   --> src/parser.rs:569:16
    |
569 | ...                   if let Some(decoded) = Entity::decode(entity) {
    |                              ^^^^^^^^^^^^^   ---------------------- this expression has type `Result<char, anyhow::Error>`
    |                              |
    |                              expected enum `Result`, found enum `Option`
    |
    = note: expected enum `Result<char, anyhow::Error>`
               found enum `Option<_>`

Some errors have detailed explanations: E0308, E0432.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `rphtml` due to 3 previous errors

Can you please adopt the changes and increase the minimum version?

Best regards,
CK

Reduce potential `panic` usage

In rust if we panicked, everything's break. There's no way to work around that, at least in straightforward manners.

Since it's a library, the user cannot predictably do stuff safely because the library can panic and user cannot handle it at all

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.