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 from_path and from_string variants that don't buffer output #86

Closed
wants to merge 14 commits into from

Commits on Oct 7, 2023

  1. Configuration menu
    Copy the full SHA
    e365bf8 View commit details
    Browse the repository at this point in the history
  2. Add is_ascii() to selectors

    hsanzg committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    41af10d View commit details
    Browse the repository at this point in the history
  3. Add is_ascii() to values

    hsanzg committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    0471b82 View commit details
    Browse the repository at this point in the history
  4. Don't buffer serializer output

    A `Serializer` now receives an instance of `std::io::Write`. This means
    that we can no longer write the UTF-8 BOM nor the `@charset "UTF-8"
    directive when serialization is done and instead do the ASCII-content
    check while visiting the AST.
    
    All `inspect_*` methods now create a temporary buffer and pass it to a
    `Serializer`. Then they (unsafely) interpret the buffer as a UTF-8
    string. The goal is to avoid this extra set of allocations and always
    write directly to the writer passed by the API user.
    
    We also removed some extra allocations marked with todo comments.
    hsanzg committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    c015fb2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a8d607a View commit details
    Browse the repository at this point in the history
  6. Move main file to new Serializer API

    This also adds a public API to write the output of a compiled set of
    SASS files into a `Write`. We should add a recommendation to the
    rustdoc about passing a buffered writer; otherwise performance will
    probably be horrible.
    
    The previous `String`-based APIs were also moved to this new set of APIs
    by creating a temporary `Vec<u8>` buffer, passing it to the serializer,
    and finally (unsafely) reinterpreting the buffer contents as a UTF-8
    string.
    hsanzg committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    76c754c View commit details
    Browse the repository at this point in the history
  7. Handle non-ASCII units

    hsanzg committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    f79973a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fa482f1 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8ebcee4 View commit details
    Browse the repository at this point in the history
  10. Units are ASCII by default

    hsanzg committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    58bf99e View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    aa8f221 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    70f4896 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    f8e281a View commit details
    Browse the repository at this point in the history
  14. Collapse else if block

    hsanzg committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    152a635 View commit details
    Browse the repository at this point in the history