Skip to content

Commit

Permalink
👷 chwd: provide lib crate
Browse files Browse the repository at this point in the history
  • Loading branch information
vnepogodin committed Oct 27, 2024
1 parent 5180a82 commit 762d373
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ panic = "abort"
lto = true
opt-level = 3
codegen-units = 1

[lib]
name = "chwd"
path = "src/lib.rs"
21 changes: 21 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (C) 2024 Vladislav Nepogodin
//
// This file is part of CachyOS chwd.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

pub mod consts;
pub mod localization;
pub mod profile;
8 changes: 3 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@

pub mod args;
pub mod console_writer;
pub mod consts;
pub mod data;
pub mod device;
pub mod localization;
pub mod logger;
pub mod misc;
pub mod profile;

use misc::Transaction;
use profile::Profile;
use chwd::*;
use chwd::profile::Profile;

use std::path::Path;
use std::sync::Arc;
Expand All @@ -40,7 +38,7 @@ use subprocess::{Exec, Redirection};

fn main() -> anyhow::Result<()> {
let requested_languages = DesktopLanguageRequester::requested_languages();
let localizer = crate::localization::localizer();
let localizer = chwd::localization::localizer();
if let Err(error) = localizer.select(&requested_languages) {
eprintln!("Error while loading languages for library_fluent {}", error);
}
Expand Down

0 comments on commit 762d373

Please sign in to comment.