Commit 1557fab0 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'openstruct-ansi2html' into 'master'

Replace OpenStruct with Struct

See merge request gitlab-org/gitlab!58430
parents bf7269e2 30739d4d
...@@ -30,6 +30,8 @@ module Gitlab ...@@ -30,6 +30,8 @@ module Gitlab
Converter.new.convert(ansi, state) Converter.new.convert(ansi, state)
end end
Result = Struct.new(:html, :state, :append, :truncated, :offset, :size, :total, keyword_init: true) # rubocop:disable Lint/StructNewOverride
class Converter class Converter
def on_0(_) def on_0(_)
reset reset
...@@ -278,9 +280,7 @@ module Gitlab ...@@ -278,9 +280,7 @@ module Gitlab
close_open_tags close_open_tags
# TODO: replace OpenStruct with a better type Ansi2html::Result.new(
# https://gitlab.com/gitlab-org/gitlab/issues/34305
OpenStruct.new(
html: @out.force_encoding(Encoding.default_external), html: @out.force_encoding(Encoding.default_external),
state: state, state: state,
append: append, append: append,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment