<commit_before>﻿using System;
using System.IO.Abstractions;

namespace Aim.SpecLogLogoReplacer.UI
{
  public class SettingsManager
  {
    private readonly IFileSystem fileSystem;

    public SettingsManager(IFileSystem fileSystem)
    {
      if (fileSystem == null) throw new ArgumentNullException("fileSystem");

      this.fileSystem = fileSystem;
    }

    public void SaveSettings(string path, Settings settings)
    {
      if (string.IsNullOrWhiteSpace(path)) throw new ArgumentNullException("path");
      if (settings == null) throw new ArgumentNullException("settings");

      using (var stream = this.fileSystem.File.OpenWrite(path))
      {
        stream.Serialize<Settings>(settings);
      }
    }

    public Settings LoadSettings(string path)
    {
      if (string.IsNullOrWhiteSpace(path)) throw new ArgumentNullException("path");

      Settings result;

      using (var stream = this.fileSystem.File.OpenRead(path))
      {
        result = stream.Deserialize<Settings>();
      }

      return result;
    }
  }
}<commit_msg>Fix error when seria<commit_after>﻿using System;
using System.IO.Abstractions;

namespace Aim.SpecLogLogoReplacer.UI
{
  public class SettingsManager
  {
    private readonly IFileSystem fileSystem;

    public SettingsManager(IFileSystem fileSystem)
    {
      if (fileSystem == null) throw new ArgumentNullException("fileSystem");

      this.fileSystem = fileSystem;
    }

    public void SaveSettings(string path, Settings settings)
    {
      if (string.IsNullOrWhiteSpace(path)) throw new ArgumentNullException("path");
      if (settings == null) throw new ArgumentNullException("settings");

      this.fileSystem.File.Delete(path);

      using (var stream = this.fileSystem.File.OpenWrite(path))
      {
        stream.Serialize<Settings>(settings);
      }
    }

    public Settings LoadSettings(string path)
    {
      if (string.IsNullOrWhiteSpace(path)) throw new ArgumentNullException("path");

      Settings result;

      using (var stream = this.fileSystem.File.OpenRead(path))
      {
        result = stream.Deserialize<Settings>();
      }

      return result;
    }
  }
}
{'fraction_non_alphanumeric': 0.099488609948861, 'fraction_numerical': 0.0, 'mean_word_length': 3.2113502935420746, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1509590', 'n_tokens_mistral': 601, 'n_tokens_neox': 586, 'n_words': 134}