You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: changelog.rs
    path of file: ./repos/git-cliff/git-cliff-core/src
    
    the code of the file until where you have to start completion: use crate::commit::Commit;
use crate::config::Config;
use crate::error::Result;
#[cfg(feature = "github")]
use crate::github::{
	GitHubClient,
	GitHubCommit,
	GitHubPullRequest,
	FINISHED_FETCHING_MSG,
	START_FETCHING_MSG,
};
use crate::release::{
	Release,
	Releases,
};
use crate::template::Template;
use std::collections::HashMap;
use std::io::Write;
use std::time::{
	SystemTime,
	UNIX_EPOCH,
};

/// Changelog generator.
#[derive(Debug)]
pub struct Changelog<'a> {
	/// Releases that the changelog will contain.
	pub releases:    Vec<Release<'a>>,
	body_template:   Template,
	footer_template: Option<Template>,
	config:          &'a Config,
}

impl<'a> Changelog<'a> {
	/// Constructs a new instance.
	pub fn new(releases: Vec<Release<'a>>, config: &'a Config) -> Result<Self> {
		let trim = config.changelog.trim.unwrap_or(true);
		let mut changelog = Self {
			releases,
			body_template: Template::new(
				config
					.changelog
					.body
					.as_deref()
					.unwrap_or_
    
	fn changelog_generator() -> Result<()> {
		let (config, releases) = get_test_data();
		let mut changelog = Changelog::new(releases, &config)?;
		changelog.bump_version()?;
		changelog.releases[0].timestamp = 0;
		let mut out = Vec::new();
		changelog.generate(&mut out)?;
		assert_eq!(
			String::from(
				r#"# Changelog
			## Release [v1.1.0] - 1970-01-01


			### Bug Fixes
			#### app
			- fix abc

			### New features
			#### app
			- add xyz

			### Other
			#### app
			- document zyx

			#### ui
			- do exciting stuff

			## Release [v1.0.0] - 1971-08-02
			(0bc123)

			### Bug Fixes
			#### ui
			- fix more stuff

			### Documentation
			#### documentation
			- update docs
			- add some documentation

			### I love tea
			#### app
			- damn right

			### Matched (group)
			#### group
			- support regex-replace for groups

			### New features
			#### app
			- add cool features

			#### other
			- support unscoped commits
			- support breaking commits

			### Other
			#### app
			- do nothing

			#### other
			- support unconventional commits
			- this commit is preprocessed

			#### ui
			- make good stuff
			-- total releases: 2 --
			"#
			)
			.replace("			", ""),
			str::from_utf8(&out).unwrap_or_default()
		);
		Ok(())
	}