Skip to content

Commit

Permalink
add example project
Browse files Browse the repository at this point in the history
  • Loading branch information
kkent030315 committed Dec 26, 2023
1 parent 71756f4 commit 730bae0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ default = ["deflate", "zstd"]
deflate = ["include-flate-compress/deflate"]
zstd = ["include-flate-compress/zstd"]
no-compression-warnings = ["include-flate-codegen/no-compression-warnings"]

[[example]]
name = "flate"
1 change: 1 addition & 0 deletions assets/hello-world.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello, World!🌅
22 changes: 22 additions & 0 deletions examples/flate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// include-flate
// Copyright (C) SOFe, kkent030315
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use include_flate::flate;

flate!(pub static HELLO_WORLD: str from "assets/hello-world.txt" with deflate if always);

fn main() {
println!("{}", *HELLO_WORLD);
}

0 comments on commit 730bae0

Please sign in to comment.