message: adapt writers example to new design
diff: @@ -14,7 +14,6 @@ use argmin::testfunctions::rosenbrock;
  use argmin_core::finitediff::*;
  use ndarray::{array, Array1, Array2};
  use serde::{Deserialize, Serialize};
  -use std::sync::Arc;
  #[derive(Clone, Default, Serialize, Deserialize)]
  struct Rosenbrock {
  @@ -52,28 +51,24 @@ fn run() -> Result<(), Error> {
  let solver = BFGS::new(init_hessian, linesearch);
  // Create writer
  - let mut writer = WriteToFile::new("params", "param");
  -
  + let writer = WriteToFile::new("params", "param")
  // Only save every 3 iterations
  - writer.set_mode(WriterMode::Every(3));
  -
  + .mode(WriterMode::Every(3))
  // Set serializer to JSON
  - writer.set_serializer(WriteToFileSerializer::JSON);
  + .serializer(WriteToFileSerializer::JSON);
  // Create writer which only saves new best ones
  - let mut writer2 = WriteToFile::new("params", "best");
  -
  + let writer2 = WriteToFile::new("params", "best")
  // Only save new best
  - writer2.set_mode(WriterMode::NewBest);
  -
  + .mode(WriterMode::NewBest)
  // Set serializer to JSON
  - writer2.set_serializer(WriteToFileSerializer::JSON);
  + .serializer(WriteToFileSerializer::JSON);
  let res = Executor::new(cost, solver, init_param)
  .max_iters(10)
  .add_observer(ArgminSlogLogger::term())
  - .add_observer(Arc::new(writer))
  - .add_observer(Arc::new(writer2))
  + .add_observer(writer)
  + .add_observer(writer2)
  .run()?;
  // Wait a second (lets the logger flush everything before printing again)
  